about summary refs log tree commit diff
path: root/converter
diff options
context:
space:
mode:
Diffstat (limited to 'converter')
-rw-r--r--converter/other/pamtogif.c8
-rw-r--r--converter/other/pamtoxvmini.c2
2 files changed, 9 insertions, 1 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);
 
diff --git a/converter/other/pamtoxvmini.c b/converter/other/pamtoxvmini.c
index dc56e912..449b3c99 100644
--- a/converter/other/pamtoxvmini.c
+++ b/converter/other/pamtoxvmini.c
@@ -212,7 +212,7 @@ writeXvRaster(struct pam * const pamP,
     }
 
     pm_freerow((char*)xvrow);
-    pnm_freepamrow(pamP);
+    pnm_freepamrow(tuplerow);
 
     pnm_destroytuplehash(paletteHash);
 }