[FFmpeg-cvslog] avcodec/scpr3: Check bx

Michael Niedermayer git at videolan.org
Sun Apr 16 01:41:21 EEST 2023


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Mon Jan 16 00:01:13 2023 +0100| [b3534598203c54b2b556275029468277dfe22241] | committer: Michael Niedermayer

avcodec/scpr3: Check bx

Fixes: Out of array access
Fixes: 55102/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-4877396618903552

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 cc7e984a05b28dcfaaaad95afa061be71b4ba7fc)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/scpr3.c b/libavcodec/scpr3.c
index 1ed764baa1..f56ae19118 100644
--- a/libavcodec/scpr3.c
+++ b/libavcodec/scpr3.c
@@ -1184,6 +1184,9 @@ static int decompress_p3(AVCodecContext *avctx,
                 int run, bx = x * 16 + sx1, by = y * 16 + sy1;
                 uint32_t clr, ptype = 0, r, g, b;
 
+                if (bx >= avctx->width)
+                    return AVERROR_INVALIDDATA;
+
                 for (; by < y * 16 + sy2 && by < avctx->height;) {
                     ret = decode_value3(s, 5, &s->op_model3[ptype].cntsum,
                                         s->op_model3[ptype].freqs[0],



More information about the ffmpeg-cvslog mailing list