File: 1007147-openbox-imlib-free-image-NULL.patch

package info (click to toggle)
openbox 3.7~rc2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 5,892 kB
  • sloc: ansic: 38,834; xml: 1,358; sh: 665; makefile: 613; python: 421
file content (30 lines) | stat: -rw-r--r-- 795 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Description: fix openbox invokes imlib_free_image when no image is loaded
Author: Grant
Bug-Debian: https://bugs.debian.org/1007147
Origin: upstream
Forwarded: https://bugzilla.icculus.org/show_bug.cgi?id=6447#c0

diff --git a/obrender/image.c b/obrender/image.c
index cffbaf3..5c689c4 100644
--- a/obrender/image.c
+++ b/obrender/image.c
@@ -476,17 +476,18 @@ struct _ImlibLoader
     Imlib_Image img;
 };
 
 void DestroyImlibLoader(ImlibLoader *loader)
 {
     if (!loader)
         return;
 
-    imlib_free_image();
+    if (loader->img)
+        imlib_free_image();
     g_slice_free(ImlibLoader, loader);
 }
 
 ImlibLoader* LoadWithImlib(gchar *path,
                            RrPixel32 **pixel_data,
                            gint *width,
                            gint *height)
 {