GNOME Bugzilla – Bug 775232
pnm loader loads images with height=-2072745076
Last modified: 2016-12-13 17:13:03 UTC
Created attachment 340908 [details] crashing file, password "crash" It seems that a pathological PNM file can cause the following crash: (process:26213): GdkPixbuf-CRITICAL **: gdk_pixbuf_new: assertion 'height > 0' failed Program received signal SIGTRAP, Trace/breakpoint trap. 0x00007ffff6881a6b in g_logv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
+ Trace 236890
Thread 1 (Thread 0x7ffff7fc3880 (LWP 26213))
Created attachment 340909 [details] [review] patch Potential patch. It makes pixbuf-read not crash, but I don't know whether checking for <=0 has other unwanted implications.
Created attachment 341895 [details] [review] pnm: Fix crash opening images with overly large dimensions Internally, the PNM loader stores the width and height as unsigned integers, but the external callback to the application, GdkPixbufModuleSizeFunc, uses integers. So the maximum width and height really are MAXINT, not MAXUINT.
Created attachment 341896 [details] [review] tests: Add test for bug 775232
Attachment 341895 [details] pushed as 8d54caa - pnm: Fix crash opening images with overly large dimensions Attachment 341896 [details] pushed as afdff2c - tests: Add test for bug 775232