diff options
Diffstat (limited to 'pgm-interlace.c')
-rw-r--r-- | pgm-interlace.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pgm-interlace.c b/pgm-interlace.c index 861f30b..21226a7 100644 --- a/pgm-interlace.c +++ b/pgm-interlace.c @@ -45,6 +45,12 @@ int check_sanity(long width, long height, long white, unsigned int clust_total) return 1; } + if (white <= 0) + { + fprintf(stderr, "white value must be positive\n"); + return 1; + } + /* FIXME only support single-byte pixels, PGM supports 16-bit according * to <http://netpbm.sourceforge.net/doc/pgm.html> */ if (white > 255) |