83bc7c
--- libwmf-0.2.8.4/src/extra/gd/gd.c
83bc7c
+++ libwmf-0.2.8.4/src/extra/gd/gd.c
83bc7c
@@ -2483,6 +2483,10 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm (FILE * fd)
83bc7c
     }
83bc7c
   bytes = (w * h / 8) + 1;
83bc7c
   im = gdImageCreate (w, h);
83bc7c
+  if (!im) {
83bc7c
+    return 0;
83bc7c
+  }
83bc7c
+
83bc7c
   gdImageColorAllocate (im, 255, 255, 255);
83bc7c
   gdImageColorAllocate (im, 0, 0, 0);
83bc7c
   x = 0;