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