about summary refs log tree commit diff
path: root/converter/other/pamtogif.c
diff options
context:
space:
mode:
Diffstat (limited to 'converter/other/pamtogif.c')
-rw-r--r--converter/other/pamtogif.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/converter/other/pamtogif.c b/converter/other/pamtogif.c
index ef3441cb..e1f5f85b 100644
--- a/converter/other/pamtogif.c
+++ b/converter/other/pamtogif.c
@@ -1417,6 +1417,14 @@ gifEncode(struct pam *  const pamP,
 
     reportImageInfo(gInterlace, background, bitsPerPixel);
 
+    if (pamP->width > 65535)
+        pm_error("Image width %u too large for GIF format.  (Max 65535)",
+                 pamP->width);
+    
+    if (pamP->height > 65535)
+        pm_error("Image height %u too large for GIF format.  (Max 65535)",
+                 pamP->height);
+
     writeGifHeader(ofP, pamP->width, pamP->height, background,
                    bitsPerPixel, cmapP, comment);