about summary refs log tree commit diff
path: root/converter
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 /converter
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
Diffstat (limited to 'converter')
-rw-r--r--converter/other/pngtopam.c7
-rw-r--r--converter/other/pngtopnm.c7
2 files changed, 14 insertions, 0 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],