[FFmpeg-devel] [PATCH 2/4] avformat/wavdec: Check avio_get_str16le() for failure

Paul B Mahol onemda at gmail.com
Sat Jan 30 19:09:50 EET 2021


lgtm

On Sat, Jan 30, 2021 at 4:07 PM Michael Niedermayer <michael at niedermayer.cc>
wrote:

> Fixes: out of array access
> Fixes:
> 29195/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-5037853281222656
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by
> <https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by>:
> Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavformat/wavdec.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
> index 3da4150f05..2fba9a08c8 100644
> --- a/libavformat/wavdec.c
> +++ b/libavformat/wavdec.c
> @@ -922,6 +922,10 @@ static int w64_read_header(AVFormatContext *s)
>                      return AVERROR(ENOMEM);
>
>                  ret = avio_get_str16le(pb, chunk_size, value, chunk_size);
> +                if (ret < 0) {
> +                    av_free(value);
> +                    return ret;
> +                }
>                  avio_skip(pb, chunk_size - ret);
>
>                  av_dict_set(&s->metadata, chunk_key, value,
> AV_DICT_DONT_STRDUP_VAL);
> --
> 2.17.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list