mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 18:40:03 +01:00
avcodec/g729_parser: Check block_size
Fixes: Infinite loop
Fixes: 17611/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ACELP_KELVIN_fuzzer-5765134928052224
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 972a0a818f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -51,6 +51,12 @@ static int g729_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
|
|||||||
s->duration = avctx->frame_size;
|
s->duration = avctx->frame_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!s->block_size) {
|
||||||
|
*poutbuf = buf;
|
||||||
|
*poutbuf_size = buf_size;
|
||||||
|
return buf_size;
|
||||||
|
}
|
||||||
|
|
||||||
if (!s->remaining)
|
if (!s->remaining)
|
||||||
s->remaining = s->block_size;
|
s->remaining = s->block_size;
|
||||||
if (s->remaining <= buf_size) {
|
if (s->remaining <= buf_size) {
|
||||||
|
|||||||
Reference in New Issue
Block a user