about summary refs log tree commit diff
path: root/editor/specialty
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-02-09 18:05:14 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-02-09 18:05:14 +0000
commit986fb1796a2025591ef01778baccf45ae4341cd8 (patch)
tree69a8dc2712e9b679d9ffa4219e7197d024626682 /editor/specialty
parent6df52cf3846ae2afe8c3b633cd28126937311e90 (diff)
downloadnetpbm-mirror-986fb1796a2025591ef01778baccf45ae4341cd8.tar.gz
netpbm-mirror-986fb1796a2025591ef01778baccf45ae4341cd8.tar.xz
netpbm-mirror-986fb1796a2025591ef01778baccf45ae4341cd8.zip
Fix for -takeodd on image with no odd rows
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2122 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor/specialty')
-rw-r--r--editor/specialty/pamdeinterlace.c8
1 files changed, 7 insertions, 1 deletions
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 */