about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-11-22 22:08:01 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-11-22 22:08:01 +0000
commitb455edade964edf9ff705814835b81e5b01403a5 (patch)
tree90bef5f8cccd2561689dfc8259b671f87ad6656b
parent710952ec33cb9428f444bc2bcd4d29a1d24c5899 (diff)
downloadnetpbm-mirror-b455edade964edf9ff705814835b81e5b01403a5.tar.gz
netpbm-mirror-b455edade964edf9ff705814835b81e5b01403a5.tar.xz
netpbm-mirror-b455edade964edf9ff705814835b81e5b01403a5.zip
Release 10.47.33
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@1601 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/pngtopam.c7
-rw-r--r--converter/other/pngtopnm.c7
-rw-r--r--doc/HISTORY5
-rw-r--r--version.mk2
4 files changed, 20 insertions, 1 deletions
diff --git a/converter/other/pngtopam.c b/converter/other/pngtopam.c
index 0eb00ee2..ee46ca0e 100644
--- a/converter/other/pngtopam.c
+++ b/converter/other/pngtopam.c
@@ -305,6 +305,13 @@ static void show_time (png_info *info_ptr)
     };
 
   if (info_ptr->valid & PNG_INFO_tIME) {
+    if (info_ptr->mod_time.month < 1 ||
+      info_ptr->mod_time.month >= ARRAY_SIZE(month)) {
+      pm_message("tIME chunk in PNG input is invalid; "
+                 "modification time of image is unknown.  "
+                 "The month value, which should be in the range "
+                 "1-12, is %u", info_ptr->mod_time.month);
+    } else
     pm_message ("modification time: %02d %s %d %02d:%02d:%02d",
                 info_ptr->mod_time.day, month[info_ptr->mod_time.month],
                 info_ptr->mod_time.year, info_ptr->mod_time.hour,
diff --git a/converter/other/pngtopnm.c b/converter/other/pngtopnm.c
index 8a34df0d..a8ea25a7 100644
--- a/converter/other/pngtopnm.c
+++ b/converter/other/pngtopnm.c
@@ -484,6 +484,13 @@ showTime(struct pngx * const pngxP) {
     };
 
     if (pngxP->info_ptr->valid & PNG_INFO_tIME) {
+      if (pngxP->info_ptr->mod_time.month < 1 ||
+        pngxP->info_ptr->mod_time.month >= ARRAY_SIZE(month)) {
+        pm_message("tIME chunk in PNG input is invalid; "
+                   "modification time of image is unknown.  "
+                   "The month value, which should be in the range "
+                   "1-12, is %u", pngxP->info_ptr->mod_time.month);
+      } else
         pm_message("modification time: %02d %s %d %02d:%02d:%02d",
                    pngxP->info_ptr->mod_time.day,
                    month[pngxP->info_ptr->mod_time.month],
diff --git a/doc/HISTORY b/doc/HISTORY
index 58b26f62..434fb043 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,11 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+11.11.22 BJH  Release 10.47.33
+
+              pngtopam, pngtopnm: fix crash with invalid tIME chunk.  Always
+              broken.
+
 11.11.08 BJH  Release 10.47.32
 
               pamarith: fix wrong result with -multiply.  Broken in 10.41.
diff --git a/version.mk b/version.mk
index d1b10c03..0725ff71 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 47
-NETPBM_POINT_RELEASE = 32
+NETPBM_POINT_RELEASE = 33