set pixels with no coverage to all zero
authorTony Cook <tony@develop-help.com>
Tue, 23 Feb 2016 11:00:08 +0000 (22:00 +1100)
committerTony Cook <tony@develop-help.com>
Tue, 23 Feb 2016 11:00:08 +0000 (22:00 +1100)
valgrind complained about use of uninitialized values

rotate.im

index 861810d..250d778 100644 (file)
--- a/rotate.im
+++ b/rotate.im
@@ -152,6 +152,10 @@ static i_color interp_i_color(i_color before, i_color after, double pos,
        out.channel[ch] = I_LIMIT_8(out_level);
       }
     }
+    else {
+      for (ch = 0; ch < channels-1; ++ch)
+       out.channel[ch] = 0;
+    }
 
     out.channel[channels-1] = total_cover;
   }
@@ -188,6 +192,10 @@ static i_fcolor interp_i_fcolor(i_fcolor before, i_fcolor after, double pos,
        out.channel[ch] = I_LIMIT_DOUBLE(out_level);
       }
     }
+    else {
+      for (ch = 0; ch < channels-1; ++ch)
+       out.channel[ch] = 0;
+    }
 
     out.channel[channels-1] = total_cover;
   }