[FFmpeg-devel] [PATCH] avcodec/utils: Assert that the number of consumed bytes in avcodec_decode_audio4() is <= the input size

wm4 nfxjfg at googlemail.com
Sat Apr 23 17:41:49 CEST 2016


On Sat, 23 Apr 2016 17:34:56 +0200
Michael Niedermayer <michael at niedermayer.cc> wrote:

> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavcodec/utils.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 946ecb9..21ad3cf 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -2422,6 +2422,8 @@ fail:
>              av_frame_unref(frame);
>      }
>  
> +    av_assert0(ret <= avpkt->size);
> +
>      return ret;
>  }
>  

If you're confident that this actually holds true for all decoders,
fine.


More information about the ffmpeg-devel mailing list