diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-11-18 00:07:05 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-11-28 21:20:56 +0100 |
commit | b32316923df0fb932d4e553705328755d3096165 (patch) | |
tree | 0b7dbe16dd360adbeb644bdee5162d1cd0849a44 /libavcodec/h263dec.c | |
parent | ff2d1bbe737539b9f564e53f84b7309bc2a38243 (diff) | |
download | ffmpeg-b32316923df0fb932d4e553705328755d3096165.tar.gz |
avcodec/h263dec: Avoid parsing extradata repeatedly
Fixes: Timeout
Fixes: 52329/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-4716563886637056
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r-- | libavcodec/h263dec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 71b846ba74..ac7a8521e5 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -492,11 +492,12 @@ retry: } else if (CONFIG_MSMPEG4DEC && s->msmpeg4_version) { ret = ff_msmpeg4_decode_picture_header(s); } else if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) { - if (s->avctx->extradata_size && s->picture_number == 0) { + if (s->avctx->extradata_size && !s->extradata_parsed) { GetBitContext gb; if (init_get_bits8(&gb, s->avctx->extradata, s->avctx->extradata_size) >= 0 ) ff_mpeg4_decode_picture_header(avctx->priv_data, &gb, 1, 0); + s->extradata_parsed = 1; } ret = ff_mpeg4_decode_picture_header(avctx->priv_data, &s->gb, 0, 0); } else if (CONFIG_H263I_DECODER && s->codec_id == AV_CODEC_ID_H263I) { |