Krolyxon
Commit d049391

Branches

Refs →

nsxivd049391

Check for background image allocation failure

Author
Bert Münnich
Date
2014-02-07 22:57 +0100
Parent
4fde8c8
Commit
d049391916e4f418d6057bca9fcbd3d6e35cd15a

+3 −2

2 files changed

  1. M Makefile +1 −1
  2. M image.c +2 −1
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20140206
1+VERSION = git-20140207
22
33 PREFIX = /usr/local
44 MANPREFIX = $(PREFIX)/share/man
M image.c View
@@ -492,7 +492,8 @@ void img_render(img_t *img)
492492 imlib_context_set_drawable(win->pm);
493493
494494 if (imlib_image_has_alpha()) {
495− bg = imlib_create_image(dw, dh);
495+ if ((bg = imlib_create_image(dw, dh)) == NULL)
496+ die("could not allocate memory");
496497 imlib_context_set_image(bg);
497498 imlib_image_set_has_alpha(0);
498499