Commit c0213820 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Avoid crashes on MS-Windows when JPEG images are too large.

 src/image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: If
 CreateDIBSection returns an error indication, zero out *ximg after
 destroying the image.  This avoids crashes in memory allocations
 due to the fact that some of the callers also call
 x_destroy_x_image, which will attempt to free an already free'd
 block of memory.
parent f097a3d2
2014-02-19 Eli Zaretskii <eliz@gnu.org>
* image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: If
CreateDIBSection returns an error indication, zero out *ximg after
destroying the image. This avoids crashes in memory allocations
due to the fact that some of the callers also call
x_destroy_x_image, which will attempt to free an already free'd
block of memory.
2014-02-18 Martin Rudalics <rudalics@gmx.at>
* widget.c (update_various_frame_slots): Don't set
......
......@@ -2019,6 +2019,7 @@ x_create_x_image_and_pixmap (struct frame *f, int width, int height, int depth,
XSETINT (errcode, err);
image_error ("Unable to create bitmap, error code %d", errcode, Qnil);
x_destroy_x_image (*ximg);
*ximg = NULL;
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment