projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d1d1ce
)
Add some asserts; sws_getContext() will fail if the image width or height are 0.
author
Carl Hetherington
<cth@carlh.net>
Thu, 1 Feb 2024 12:28:38 +0000
(13:28 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Sat, 3 Feb 2024 08:57:25 +0000
(09:57 +0100)
src/lib/image.cc
patch
|
blob
|
history
diff --git
a/src/lib/image.cc
b/src/lib/image.cc
index 801b39b0fced2f9feba50b9371e500d0c4b28bdc..4c60fe8886fca9be82a3ea741390049c7f83dbf2 100644
(file)
--- 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 (