[FFmpeg-devel] [PATCH 2/2] avcodec/h263dec: Avoid parsing extradata repeatedly

Anton Khirnov anton at khirnov.net
Mon Nov 21 13:53:26 EET 2022


Quoting Michael Niedermayer (2022-11-18 00:14:18)
> 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 at niedermayer.cc>
> ---
>  libavcodec/h263dec.c   | 3 ++-
>  libavcodec/mpegvideo.h | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
> index 71b846ba74..4eab43d939 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->picture_number == 0 && !s->extradata_parsed) {

Wouldn't it make sense to get rid of the picture_number condition now?

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list