Fix corrupted image when over-cropping black filler frames.
authorCarl Hetherington <cth@carlh.net>
Tue, 24 Nov 2020 23:11:55 +0000 (00:11 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 24 Nov 2020 23:36:22 +0000 (00:36 +0100)
commite43dababfc7aaf1429d3552e91b24e4e51979111
treeddb1d0119531ea1e6e91b210b8f8413f5a904f48
parent8a1da1da65ba0e6a6fb915c73ff6e6a81da349f2
Fix corrupted image when over-cropping black filler frames.

FFmpegDecoder can emit small black frames (128x128 pixels) when it
wants to fill in a gap.  Image::crop_scale_window would do the wrong
thing if we then applied a crop of greater than 128 in either direction;
though cropped_size is correctly clamped, the crop value itself was
not and is used to calculate the input data pointers.

This would result in random frames, usually at the end of DCPs,
often made up of blurry colour washes.
src/lib/image.cc
test/data
test/image_test.cc