[FFmpeg-cvslog] swscale/swscale: Check srcSliceH for bayer

Michael Niedermayer git at videolan.org
Mon Apr 15 01:48:31 EEST 2024


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sat Feb 17 01:34:25 2024 +0100| [b4a7c55f792d99ec0b6b14596f21935fa4ebd1db] | committer: Michael Niedermayer

swscale/swscale: Check srcSliceH for bayer

Fixes: Assertion srcSliceH > 1 failed at libswscale/swscale_unscaled.c:1359
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 64098d0cd8ab1d27f78a335ca684f00a419b2160)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b4a7c55f792d99ec0b6b14596f21935fa4ebd1db
---

 libswscale/swscale.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 18974e475e..e1b5bb8241 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1053,7 +1053,8 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
 
     if ((srcSliceY & (macro_height-1)) ||
         ((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);
         return AVERROR(EINVAL);
     }



More information about the ffmpeg-cvslog mailing list