1. libgd
  2. Untitled project
  3. gd-libgd

Commits

tabe  committed bc5cb9d

fix FS#235

  • Participants
  • Parent commits 2a94fc9
  • Branches GD-2.0

Comments (0)

Files changed (1)

File src/gd_png.c

View file
   volatile int remap = FALSE;
 #ifdef PNG_SETJMP_SUPPORTED
   jmpbuf_wrapper jbw;
+#endif
+
+  /* width or height of value 0 is invalid in IHDR;
+	 see http://www.w3.org/TR/PNG-Chunks.html */
+  if (width == 0 || height ==0) return;
 
+#ifdef PNG_SETJMP_SUPPORTED
   png_ptr = png_create_write_struct (PNG_LIBPNG_VER_STRING,
 				     &jbw, gdPngErrorHandler,
 				     NULL);