1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

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>
(cherry picked from commit 64098d0cd8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-02-17 01:34:25 +01:00
parent facfb2d25d
commit e92cc45c14
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -769,7 +769,8 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
if ((srcSliceY & (macro_height-1)) || if ((srcSliceY & (macro_height-1)) ||
((srcSliceH& (macro_height-1)) && srcSliceY + srcSliceH != c->srcH) || ((srcSliceH& (macro_height-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); av_log(c, AV_LOG_ERROR, "Slice parameters %d, %d are invalid\n", srcSliceY, srcSliceH);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }