about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/HISTORY15
-rw-r--r--editor/specialty/pamdeinterlace.c8
2 files changed, 16 insertions, 7 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 5a29fb26..39d33437 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -6,12 +6,6 @@ CHANGE HISTORY
 
 not yet  BJH  Release 10.66.00
 
-              ppmrelief: fix out-of-bound values in output.
-              Thanks Prophet of the Way <afu@wta.att.ne.jp>.
-
-              ppmrelief: fix crash when input image is too small.
-              Thanks Prophet of the Way <afu@wta.att.ne.jp>.
-
               pnmmargin: fix for size 0 and superfluous "unexpected operator" 
               message with size != 0.  Introduced in 10.42.
 
@@ -22,6 +16,15 @@ not yet  BJH  Release 10.66.00
               pstopnm: fix wrong orientation sometimes when you specify
               both -xsize and -ysize.  Introduced in 10.65.
 
+              ppmrelief: fix out-of-bound values in output.  Always broken.
+              Thanks Prophet of the Way <afu@wta.att.ne.jp>.
+
+              ppmrelief: fix crash when input image is too small.  Always
+              broken.  Thanks Prophet of the Way <afu@wta.att.ne.jp>.
+
+              pamdeinterlace: fix incorrect output with -takeodd and image has
+              only one row.  Thanks Prophet of the Way <afu@wta.att.ne.jp>.
+
               build/install: add tools for creating a Debian package.
 
               make package: Include template for pkgconfig file.
diff --git a/editor/specialty/pamdeinterlace.c b/editor/specialty/pamdeinterlace.c
index aa1f3ff7..d6f6aee1 100644
--- a/editor/specialty/pamdeinterlace.c
+++ b/editor/specialty/pamdeinterlace.c
@@ -32,7 +32,7 @@ parseCommandLine(int argc, char ** argv,
    was passed to us as the argv array.
 -----------------------------------------------------------------------------*/
     optStruct3 opt;  /* set by OPTENT3 */
-    optEntry *option_def;
+    optEntry * option_def;
     unsigned int option_def_index;
 
     unsigned int takeeven, takeodd;
@@ -50,6 +50,8 @@ parseCommandLine(int argc, char ** argv,
     pm_optParseOptions3(&argc, argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
+    free(option_def);
+
     if (takeeven && takeodd)
         pm_error("You cannot specify both -takeeven and -takeodd options.");
 
@@ -90,6 +92,10 @@ main(int argc, char *argv[]) {
     
     pnm_readpaminit(ifP, &inpam, PAM_STRUCT_SIZE(tuple_type));
 
+    if (inpam.height < 2 && cmdline.rowsToTake == ODD)
+        pm_error("You requested to take the odd rows, but there aren't "
+                 "any odd rows in the image - it has only one row - Row 0");
+
     tuplerow = pnm_allocpamrow(&inpam);
 
     outpam = inpam;    /* Initial value -- most fields should be same */