- to_paletted() and make_palette() now fail (with an error in
errstr()) if invalid quantization parameters are supplied.
+ - map() would corrupt a channel if there was a gap in the arrayref of
+ channels. Detected by Coverity. CID 185300.
+
Coverity finally finished a build[1], fix a few problems:
High severity:
i_glin(im, 0, im->xsize, y, vals);
for (x = 0; x < im->xsize; ++x) {
for(ch = minset; ch<=maxset; ch++) {
- if (!maps[ch]) continue;
+ if (!(mask & (1 << ch)))
+ continue;
vals[x].channel[ch] = maps[ch][vals[x].channel[ch]];
}
}
ok($out, "map done");
}
+{ # CID 185300
+ # the check for whether a map() channel was used was incorrect
+ my @map1 = ( 0 .. 255 );
+ my $im = test_image;
+ my $cmp = test_image->copy;
+ ok($im->map(maps => [ \@map1, undef, \@map1 ]),
+ "map with gap in maps");
+ is_image($im, $cmp, "should be no changes");
+}
+
done_testing();