294826
diff -urNp old/converter/other/svgtopam.c new/converter/other/svgtopam.c
294826
--- old/converter/other/svgtopam.c	2017-02-08 12:11:02.593690917 +0100
294826
+++ new/converter/other/svgtopam.c	2017-02-08 13:49:38.319029371 +0100
294826
@@ -771,12 +771,17 @@ createCanvas(unsigned int const width,
294826
 
294826
     MALLOCVAR_NOFAIL(canvasP);
294826
 
294826
-    canvasP->width  = width;
294826
-    canvasP->height = height;
294826
-    canvasP->pixels = ppm_allocarray(width, height);
294826
-    canvasP->maxval = maxval;
294826
+    if(canvasP != NULL){
294826
+        canvasP->width  = width;
294826
+        canvasP->height = height;
294826
+        canvasP->pixels = ppm_allocarray(width, height);
294826
+        canvasP->maxval = maxval;
294826
+
294826
+        *canvasPP = canvasP;
294826
+    } else {
294826
+       pm_error("can't allocate memory for canvas");
294826
+    }
294826
 
294826
-    *canvasPP = canvasP;
294826
 }
294826
 
294826