about summary refs log tree commit diff
path: root/converter/other/pngtopnm.c
diff options
context:
space:
mode:
Diffstat (limited to 'converter/other/pngtopnm.c')
-rw-r--r--converter/other/pngtopnm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/converter/other/pngtopnm.c b/converter/other/pngtopnm.c
index 90d8705c..59149acd 100644
--- a/converter/other/pngtopnm.c
+++ b/converter/other/pngtopnm.c
@@ -313,6 +313,13 @@ 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,