diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-12-18 16:13:51 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-12-18 16:13:51 +0000 |
commit | 6636f3cb2d0e7bca933637aa232193217ea06d5b (patch) | |
tree | b9354befe6d730fdc2e081b325ebb0636bf49efc /lib/libpm.c | |
parent | a36931c48905f6de7bb28a8639e3bb22be37151b (diff) | |
download | netpbm-mirror-6636f3cb2d0e7bca933637aa232193217ea06d5b.tar.gz netpbm-mirror-6636f3cb2d0e7bca933637aa232193217ea06d5b.tar.xz netpbm-mirror-6636f3cb2d0e7bca933637aa232193217ea06d5b.zip |
Reject 0 height or width
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@494 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/libpm.c')
-rw-r--r-- | lib/libpm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libpm.c b/lib/libpm.c index 34ef3ac4..1adad8b6 100644 --- a/lib/libpm.c +++ b/lib/libpm.c @@ -786,6 +786,9 @@ pm_parse_width(const char * const arg) { } else { if (width > INT_MAX-10) pm_error("Width %u is too large for computations.", width); + if (width == 0) + pm_error("Width argument must be a positive number. You " + "specified 0."); } return width; } @@ -808,6 +811,9 @@ pm_parse_height(const char * const arg) { } else { if (height > INT_MAX-10) pm_error("Height %u is too large for computations.", height); + if (height == 0) + pm_error("Height argument must be a positive number. You " + "specified 0."); } return height; } |