diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-02-01 13:28:38 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-02-03 09:57:25 +0100 |
| commit | 54ca161fd074a7ba17d9aed8479da189374eb64e (patch) | |
| tree | edf7aeb13c2fe0cb49b7e903ba0e62b8c8dde60b | |
| parent | 9d1d1cea1cdf17b4cc2208800ca22288f979d3ec (diff) | |
Add some asserts; sws_getContext() will fail if the image width or height are 0.
| -rw-r--r-- | src/lib/image.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc index 801b39b0f..4c60fe888 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -339,6 +339,10 @@ Image::scale (dcp::Size out_size, dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_fo the input image alignment is not PADDED. */ DCPOMATIC_ASSERT (alignment() == Alignment::PADDED); + DCPOMATIC_ASSERT(size().width > 0); + DCPOMATIC_ASSERT(size().height > 0); + DCPOMATIC_ASSERT(out_size.width > 0); + DCPOMATIC_ASSERT(out_size.height > 0); auto scaled = make_shared<Image>(out_format, out_size, out_alignment); auto scale_context = sws_getContext ( |
