]> git.imager.perl.org - imager.git/commitdiff
fixes to the fountain filter
authorTony Cook <tony@develop-help.com>
Thu, 3 Jan 2019 11:10:17 +0000 (22:10 +1100)
committerTony Cook <tony@develop-help.com>
Thu, 3 Jan 2019 11:10:17 +0000 (22:10 +1100)
Changes
filters.im

diff --git a/Changes b/Changes
index 691def68d84f253c578f7d41a7bab97aeb31d959..eab9b6885ff8fd0aed6f2108f7d06a55a0de9115 100644 (file)
--- a/Changes
+++ b/Changes
@@ -85,6 +85,12 @@ High severity:
  - remove an unneeded check when terminating the stream for JPEG
    writing.  CID 185347.
 
+ - skip an unneeded check when freeing the combine temp buffer in the
+   fountain filter.  CID 185286.
+
+ - check the combine function pointer consistently rather than the
+   combine code in one place in the fountain filter.
+
 Imager 1.008 - 31 Dec 2018
 ============
 
index e247c9ccc4c64df20ef37251655eac3f59d00e13..51f2d10036f2bab20a8b1183a335bed2d52f2400 100644 (file)
@@ -1768,8 +1768,9 @@ i_fountain(i_img *im, double xa, double ya, double xb, double yb,
   line = mymalloc(line_bytes); /* checked 17feb2005 tonyc */
 
   i_get_combine(combine, &combine_func, &combinef_func);
-  if (combinef_func)
+  if (combinef_func) {
     work = mymalloc(line_bytes); /* checked 17feb2005 tonyc */
+  }
 
   fount_init_state(&state, xa, ya, xb, yb, type, repeat, combine, 
                    super_sample, ssample_param, count, segs);
@@ -1784,18 +1785,18 @@ i_fountain(i_img *im, double xa, double ya, double xb, double yb,
       else
         got_one = state.ssfunc(&c, x, y, &state);
       if (got_one) {
-        if (combine)
+        if (combinef_func)
           work[x] = c;
         else 
           line[x] = c;
       }
     }
-    if (combine)
+    if (combinef_func)
       combinef_func(line, work, im->channels, im->xsize);
     i_plinf(im, 0, im->xsize, y, line);
   }
   fount_finish_state(&state);
-  if (work) myfree(work);
+  myfree(work);
   myfree(line);
 
   return 1;