[FFmpeg-cvslog] avcodec/utils: Ensure linesize for SVQ3

Michael Niedermayer git at videolan.org
Sat Apr 8 01:08:30 EEST 2023


ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Wed Jan 11 19:39:38 2023 +0100| [bc9e149c2a0b79290d815bf62343b94b8b430e61] | committer: Michael Niedermayer

avcodec/utils: Ensure linesize for SVQ3

Fixes: Assertion block_w * sizeof(uint8_t) <= ((buf_linesize) >= 0 ? (buf_linesize) : (-(buf_linesize))
Fixes: 54861/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ3_fuzzer-5352418248622080

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 4eef658ca59d3d6ba46ab52a36d7faf5fe820874)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/utils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 60bfddc657..fdc3de1b1d 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -330,6 +330,9 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
         // the next rounded up width is 32
         *width = FFMAX(*width, 32);
     }
+    if (s->codec_id == AV_CODEC_ID_SVQ3) {
+        *width = FFMAX(*width, 32);
+    }
 
     for (i = 0; i < 4; i++)
         linesize_align[i] = STRIDE_ALIGN;



More information about the ffmpeg-cvslog mailing list