diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-09-02 20:34:18 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-09-02 20:34:18 +0000 |
commit | f4a966318d7275a4e17339866cffc644b2ee674e (patch) | |
tree | 6c070b26e1075a2fa2432c179a17a5a78f4c4d3c /converter | |
parent | b768cb11aa4cbf3b419aae2ae2b9da854f92cfd2 (diff) | |
download | netpbm-mirror-f4a966318d7275a4e17339866cffc644b2ee674e.tar.gz netpbm-mirror-f4a966318d7275a4e17339866cffc644b2ee674e.tar.xz netpbm-mirror-f4a966318d7275a4e17339866cffc644b2ee674e.zip |
Fix arithmetic overflow
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4628 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter')
-rw-r--r-- | converter/other/tifftopnm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/converter/other/tifftopnm.c b/converter/other/tifftopnm.c index 0c301a4a..e8f076a4 100644 --- a/converter/other/tifftopnm.c +++ b/converter/other/tifftopnm.c @@ -1372,6 +1372,9 @@ convertRasterByRows(pnmOut * const pnmOutP, if (scanbuf == NULL) pm_error("can't allocate memory for scanline buffer"); + if (UINT_MAX/cols < spp) + pm_error("Image is too wide/deep (%u x %u) for computations", + cols, spp); MALLOCARRAY(samplebuf, cols * spp); if (samplebuf == NULL) pm_error("can't allocate memory for row buffer"); |