Fix two crashes upon startup
* src/image.c (image_create_bitmap_from_data) (image_create_bitmap_from_file): Specify a Window or a Pixmap describing the screen, not a back buffer drawable which may not exist. Otherwise, Emacs crashes on startup when a bitmap icon is in use.
This commit is contained in:
parent
44ebd9cbd5
commit
a40f181623
1 changed files with 6 additions and 3 deletions
|
@ -479,7 +479,8 @@ image_create_bitmap_from_data (struct frame *f, char *bits,
|
||||||
|
|
||||||
#ifdef HAVE_X_WINDOWS
|
#ifdef HAVE_X_WINDOWS
|
||||||
Pixmap bitmap;
|
Pixmap bitmap;
|
||||||
bitmap = XCreateBitmapFromData (FRAME_X_DISPLAY (f), FRAME_X_DRAWABLE (f),
|
bitmap = XCreateBitmapFromData (FRAME_X_DISPLAY (f),
|
||||||
|
dpyinfo->root_window,
|
||||||
bits, width, height);
|
bits, width, height);
|
||||||
if (! bitmap)
|
if (! bitmap)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -729,8 +730,10 @@ image_create_bitmap_from_file (struct frame *f, Lisp_Object file)
|
||||||
|
|
||||||
filename = SSDATA (found);
|
filename = SSDATA (found);
|
||||||
|
|
||||||
result = XReadBitmapFile (FRAME_X_DISPLAY (f), FRAME_X_DRAWABLE (f),
|
result = XReadBitmapFile (FRAME_X_DISPLAY (f),
|
||||||
filename, &width, &height, &bitmap, &xhot, &yhot);
|
dpyinfo->root_window,
|
||||||
|
filename, &width, &height, &bitmap,
|
||||||
|
&xhot, &yhot);
|
||||||
if (result != BitmapSuccess)
|
if (result != BitmapSuccess)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue