aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-02-17 01:34:25 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2024-02-21 18:24:16 +0100
commit64098d0cd8ab1d27f78a335ca684f00a419b2160 (patch)
tree2b708e502933197d23c779c1143028b61be042e3
parent18f26f8a2f8dc3b9ec3ac3ab8e03fce15cc8c88d (diff)
downloadffmpeg-64098d0cd8ab1d27f78a335ca684f00a419b2160.tar.gz
swscale/swscale: Check srcSliceH for bayer
Fixes: Assertion srcSliceH > 1 failed at libswscale/swscale_unscaled.c:1359 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libswscale/swscale.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 46ba68fe6a..7bea5147db 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -904,7 +904,8 @@ static int scale_internal(SwsContext *c,
if ((srcSliceY & (macro_height_src - 1)) ||
((srcSliceH & (macro_height_src - 1)) && srcSliceY + srcSliceH != c->srcH) ||
- srcSliceY + srcSliceH > c->srcH) {
+ srcSliceY + srcSliceH > c->srcH ||
+ (isBayer(c->srcFormat) && srcSliceH <= 1)) {
av_log(c, AV_LOG_ERROR, "Slice parameters %d, %d are invalid\n", srcSliceY, srcSliceH);
return AVERROR(EINVAL);
}