about summary refs log tree commit diff
path: root/editor/pbmmask.c
diff options
context:
space:
mode:
Diffstat (limited to 'editor/pbmmask.c')
-rw-r--r--editor/pbmmask.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/pbmmask.c b/editor/pbmmask.c
index 21ada6b9..25c71226 100644
--- a/editor/pbmmask.c
+++ b/editor/pbmmask.c
@@ -143,6 +143,11 @@ main(int argc, char * argv[]) {
         pm_usage( usage );
 
     bits = pbm_readpbm( ifp, &cols, &rows );
+
+    if (cols == 0 || rows == 0)
+        pm_error("Image contains no pixels, so there is no such thing "
+                 "as background and foreground");
+
     pm_close( ifp );
     mask = pbm_allocarray( cols, rows );