Derek Buitenhuis <[email protected]> writes:

> From: Michael Niedermayer <[email protected]>
>
> Signed-off-by: Michael Niedermayer <[email protected]>
> ---
>  libavcodec/v410dec.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c
> index 71cbe0b..54c9595 100644
> --- a/libavcodec/v410dec.c
> +++ b/libavcodec/v410dec.c
> @@ -55,6 +55,11 @@ static int v410_decode_frame(AVCodecContext *avctx, void 
> *data,
>      if (pic->data[0])
>          avctx->release_buffer(avctx, pic);
>
> +    if (avpkt->size < 4 * avctx->height * avctx->width) {
> +        av_log(avctx, AV_LOG_ERROR, "Insufficient input data.\n");
> +        return AVERROR(EINVAL);
> +    }

I think a standard message and perhaps a dedicated error code for this
condition might be a good idea.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to