diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-11-04 12:04:30 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-11-04 12:04:30 +0100 |
| commit | 25d968fdcf1abada4bd7bbcb8c72eeebda73b134 (patch) | |
| tree | 7506338b248d10f751103ba0148e0d57d0534c2d /test | |
| parent | 16013e6658cdba6f5682b6e57402094d142b5f84 (diff) | |
Fix out-of-bounds read when cropping JPEG2000 images (#1654).
Diffstat (limited to 'test')
| -rw-r--r-- | test/image_test.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/image_test.cc b/test/image_test.cc index 1332f1c52..8378207cf 100644 --- a/test/image_test.cc +++ b/test/image_test.cc @@ -267,12 +267,13 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test) check_image("test/data/crop_scale_window_test.png", "build/test/crop_scale_window_test.png"); } -/** Special case of Image::crop_scale_window which triggered some valgrind warnings */ +/** Special cases of Image::crop_scale_window which triggered some valgrind warnings */ BOOST_AUTO_TEST_CASE (crop_scale_window_test2) { - shared_ptr<Image> image (new Image(AV_PIX_FMT_XYZ12LE, dcp::Size(2048, 858), true)); + /* This 2048 does the same as J2KImageProxy does when it makes an image */ + shared_ptr<Image> image (new Image(AV_PIX_FMT_XYZ12LE, dcp::Size(2048, 858), true, 2048)); image->crop_scale_window (Crop(279, 0, 0, 0), dcp::Size(1069, 448), dcp::Size(1069, 578), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, false, false); - + image->crop_scale_window (Crop(2048, 0, 0, 0), dcp::Size(1069, 448), dcp::Size(1069, 578), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, false, false); } BOOST_AUTO_TEST_CASE (as_png_test) |
