ref: 51e5aec5046d35f7cecce27851d37f96756a4e2d
parent: a80fd7e75416e51c43e97da0b874cbf7c5e5fb92
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Fri Jan 25 09:14:31 EST 2013
jpg: check read count when reading png magic (harmless)
--- a/sys/src/cmd/jpg/readpng.c
+++ b/sys/src/cmd/jpg/readpng.c
@@ -388,8 +388,8 @@
ZlibW zw;
buf = pngmalloc(IDATSIZE, 0);
- Bread(b, buf, sizeof PNGmagic);
- if(memcmp(PNGmagic, buf, sizeof PNGmagic) != 0)
+ if(Bread(b, buf, sizeof PNGmagic) != sizeof PNGmagic
+ || memcmp(PNGmagic, buf, sizeof PNGmagic) != 0)
sysfatal("bad PNGmagic");n = getchunk(b, type, buf, IDATSIZE);
--
⑨