[FFmpeg-cvslog] avcodec/cpia: Fix missing src_size update

Michael Niedermayer git at videolan.org
Wed Sep 8 22:42:53 EEST 2021


ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Mon Jun 21 22:59:04 2021 +0200| [8f0d442434436787c1e96152f46f4a41bf08a11b] | committer: Michael Niedermayer

avcodec/cpia: Fix missing src_size update

Fixes: out of array read
Fixes: 35210/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CPIA_fuzzer-5669199688105984

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

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

 libavcodec/cpia.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c
index 5f12a99a83..435834d617 100644
--- a/libavcodec/cpia.c
+++ b/libavcodec/cpia.c
@@ -111,6 +111,7 @@ static int cpia_decode_frame(AVCodecContext *avctx,
         // Read line length, two byte little endian
         linelength = AV_RL16(src);
         src += 2;
+        src_size -= 2;
 
         if (src_size < linelength) {
             frame->decode_error_flags = FF_DECODE_ERROR_INVALID_BITSTREAM;



More information about the ffmpeg-cvslog mailing list