[FFmpeg-devel] [PATCH v1] avcodec/mvha: fix warning: variable 'size' set but not used

Paul B Mahol onemda at gmail.com
Fri Dec 27 18:00:41 EET 2019


lgtm

On 12/27/19, lance.lmwang at gmail.com <lance.lmwang at gmail.com> wrote:
> From: Limin Wang <lance.lmwang at gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
>  libavcodec/mvha.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavcodec/mvha.c b/libavcodec/mvha.c
> index c270063..afe5e51 100644
> --- a/libavcodec/mvha.c
> +++ b/libavcodec/mvha.c
> @@ -161,6 +161,9 @@ static int decode_frame(AVCodecContext *avctx,
>      type = AV_RB32(avpkt->data);
>      size = AV_RL32(avpkt->data + 4);
>
> +    if (size < 1 || size >= avpkt->size)
> +        return AVERROR_INVALIDDATA;
> +
>      if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
>          return ret;
>
> --
> 2.9.5
>
> _______________________________________________
> 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