- Upgraded bundled GD library to 2.0.23. (Ilia)
- Fixed possible crash inside pg_copy_(to|from) function if delimiter is more
then 1 character long. (Ilia)
+- Fixed crash inside cpdf_place_inline_image() when working with truecolor
+ images. (Ilia)
- Fixed handling of return values from storred procedures in mssql_execute()
with multiple result sets returned. (Frank)
- Fixed logic bug in session_register() which allowed registering _SESSION
}
count = 3 * im->sx * im->sy;
- if(NULL == (buffer = (unsigned char *) emalloc(count)))
- RETURN_FALSE;
+ buffer = (unsigned char *) safe_emalloc(3 * im->sx, im->sy, 0);
ptr = buffer;
for(i=0; i<im->sy; i++) {
for(j=0; j<im->sx; j++) {
- color = im->pixels[i][j];
- *ptr++ = im->red[color];
- *ptr++ = im->green[color];
- *ptr++ = im->blue[color];
+#if HAVE_LIBGD20
+ if(gdImageTrueColor(im)) {
+ if (im->tpixels && gdImageBoundsSafe(im, j, i)) {
+ color = gdImageTrueColorPixel(im, j, i);
+ *ptr++ = (color >> 16) & 0xFF;
+ *ptr++ = (color >> 8) & 0xFF;
+ *ptr++ = color & 0xFF;
+ }
+ } else {
+#endif
+ if (im->pixels && gdImageBoundsSafe(im, j, i)) {
+ color = im->pixels[i][j];
+ *ptr++ = im->red[color];
+ *ptr++ = im->green[color];
+ *ptr++ = im->blue[color];
+ }
+#if HAVE_LIBGD20
+ }
+#endif
}
}