[FFmpeg-devel] [PATCH 3/3] avcodec/huffyuvdec: Check input buffer size

Paul B Mahol onemda at gmail.com
Wed Jan 31 20:56:06 EET 2018


On 1/31/18, Michael Niedermayer <michael at niedermayer.cc> wrote:
> Fixes: Timeout
> Fixes: 5487/clusterfuzz-testcase-4696837035393024
>
> 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/huffyuvdec.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
> index 979c4b9d5c..66357bfb40 100644
> --- a/libavcodec/huffyuvdec.c
> +++ b/libavcodec/huffyuvdec.c
> @@ -919,6 +919,9 @@ static int decode_frame(AVCodecContext *avctx, void
> *data, int *got_frame,
>      AVFrame *const p = data;
>      int table_size = 0, ret;
>
> +    if (buf_size < (width * height + 7)/8)
> +        return AVERROR_INVALIDDATA;
> +

Are you sure this is enough?

Something similar you had already posted long ago.


More information about the ffmpeg-devel mailing list