From: Tony Cook Date: Tue, 23 Feb 2016 11:00:08 +0000 (+1100) Subject: set pixels with no coverage to all zero X-Git-Tag: v1.004_001~12 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/e329f022b2737e646bc73dc936a7277ddbd63b8c set pixels with no coverage to all zero valgrind complained about use of uninitialized values --- diff --git a/rotate.im b/rotate.im index 861810d4..250d778b 100644 --- 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; }