diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2008-08-29 19:47:32 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2008-08-29 19:47:32 +0000 |
commit | 37f38cafb6719d3bde8c487a597400a81d733aba (patch) | |
tree | 341b54f186747d0b39d6ac5015c66bc929eecde2 /analyzer | |
parent | fbedc8c762da4ad527b4bd695473606b4b38d412 (diff) | |
download | netpbm-mirror-37f38cafb6719d3bde8c487a597400a81d733aba.tar.gz netpbm-mirror-37f38cafb6719d3bde8c487a597400a81d733aba.tar.xz netpbm-mirror-37f38cafb6719d3bde8c487a597400a81d733aba.zip |
Release 10.35.50
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@718 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'analyzer')
-rw-r--r-- | analyzer/pgmhist.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/analyzer/pgmhist.c b/analyzer/pgmhist.c index 8f4e512e..126fe693 100644 --- a/analyzer/pgmhist.c +++ b/analyzer/pgmhist.c @@ -10,6 +10,8 @@ ** implied warranty. */ +#include <limits.h> + #include "pgm.h" #include "mallocvar.h" @@ -42,6 +44,12 @@ main( argc, argv ) pm_usage( usage ); pgm_readpgminit( ifp, &cols, &rows, &maxval, &format ); + + if (UINT_MAX / cols < rows) + pm_error("Too many pixels (%u x %u) in image. " + "Maximum computable is %u", + cols, rows, UINT_MAX); + grayrow = pgm_allocrow( cols ); /* Build histogram. */ |