about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/HISTORY14
-rw-r--r--lib/libpm.c4
2 files changed, 13 insertions, 5 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 8628a508..c9bd8c74 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -15,20 +15,24 @@ not yet  BJH  Release 10.56.00
               pnmtops: Add PBM fast path.  Thanks Prophet of the Way
               <afu@wta.att.ne.jp>.
 
-              libppmcmap and most programs that use color maps: speedup with
+              libnetpbm and most programs that use color maps: speedup with
               new color hash function.  Thanks Prophet of the Way
               <afu@wta.att.ne.jp>.
 
-              pnmtopng: fix bug: with -alpha specifying a mask which contains
-              no fully transparent area, output PNG is fully opaque.
-              Introduced in 10.29.
-
               pnmquant: use File::Temp::tempfile() instead of local
               approximation if it is available.
 
               pnmquant: work with older Perl that doesn't have 3-argument open.
               Thanks Slaven Rezic <srezic@iconmobile.com>.
 
+              libnetpbm, many programs: fix bug in pm_allocarray(): returns
+              NULL when can't get memory.  Calling programs thus crash on
+              very large images.  Introduced in 10.51.
+              
+              pnmtopng: fix bug: with -alpha specifying a mask which contains
+              no fully transparent area, output PNG is fully opaque.
+              Introduced in 10.29.
+
               ppmcie: fix bug: fails with "X coordinate out of range" error.
               Introduced in 10.51.
 
diff --git a/lib/libpm.c b/lib/libpm.c
index 62ba0180..69085099 100644
--- a/lib/libpm.c
+++ b/lib/libpm.c
@@ -328,6 +328,10 @@ pm_allocarray(int const cols,
 
     pm_mallocarray2(&result, rows, cols, elementSize);
 
+    if (result == NULL)
+        pm_error("Failed to allocate a raster array of %u columns x %u rows",
+                 cols, rows);
+
     retval = result;
 
     return retval;