From bce598c9d7969f0637ce2e7e3a5bc696ab04d2f5 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 9 Dec 2007 18:21:17 +0000 Subject: properly check ridiculously large height, width git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@481 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- generator/pbmmake.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'generator') diff --git a/generator/pbmmake.c b/generator/pbmmake.c index afe1dac3..6c924ac1 100644 --- a/generator/pbmmake.c +++ b/generator/pbmmake.c @@ -75,16 +75,8 @@ parseCommandLine(int argc, char ** argv, "non-option arguments: width and height in pixels", argc-1); else { - cmdlineP->width = atoi(argv[1]); - cmdlineP->height = atoi(argv[2]); - - if (cmdlineP->width < 1) - pm_error("Width must be positive. You specified %d.", - cmdlineP->width); - - if (cmdlineP->height < 1) - pm_error("Height must be positive. You specified %d.", - cmdlineP->height); + cmdlineP->width = pm_parse_width(argv[1]); + cmdlineP->height = pm_parse_height(argv[2]); } } -- cgit 1.4.1