[FFmpeg-devel] [PATCH] avcodec/argo: Check for end of input in decode_alcd()

Michael Niedermayer michael at niedermayer.cc
Fri Jul 30 00:44:21 EEST 2021


Fixes: reading over the end
Fixes: 36346/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-5366943107383296

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/argo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/argo.c b/libavcodec/argo.c
index bbdb6ae15f..79a44d2583 100644
--- a/libavcodec/argo.c
+++ b/libavcodec/argo.c
@@ -116,6 +116,8 @@ static int decode_alcd(AVCodecContext *avctx, AVFrame *frame)
             int index;
 
             if (count == 0) {
+                if (bytestream2_get_bytes_left(gb) < 1)
+                    return AVERROR_INVALIDDATA;
                 codes = bytestream2_get_byteu(&sb);
                 count = 8;
             }
-- 
2.17.1



More information about the ffmpeg-devel mailing list