about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--converter/other/sirtopnm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/converter/other/sirtopnm.c b/converter/other/sirtopnm.c
index d7bda045..6a36a110 100644
--- a/converter/other/sirtopnm.c
+++ b/converter/other/sirtopnm.c
@@ -90,6 +90,10 @@ convertPpm(FILE *       const ifP,
     unsigned char * sirarray;  /* malloc'ed array */
     unsigned int row;
 
+    if (UINT_MAX/cols/rows < 3)
+        pm_error("Image is too large (%u x %u x %u) for computation",
+                 cols, rows, 3);
+
     MALLOCARRAY(sirarray, picsize);
 
     if (!sirarray)