[FFmpeg-devel] [PATCH 2/5] avcodec/cbs_h2645: fix crash due to assert failure on empty nalu

mypopy at gmail.com mypopy at gmail.com
Fri Oct 12 08:02:54 EEST 2018


On Fri, Oct 12, 2018 at 12:02 PM Aman Gupta <ffmpeg at tmm1.net> wrote:
>
> From: Aman Gupta <aman at tmm1.net>
>
> Signed-off-by: Aman Gupta <aman at tmm1.net>
> ---
>  libavcodec/cbs_h2645.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
> index ab33cdb69b..13e4c1561c 100644
> --- a/libavcodec/cbs_h2645.c
> +++ b/libavcodec/cbs_h2645.c
> @@ -521,7 +521,8 @@ static int cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx,
>          // Remove trailing zeroes.
>          while (size > 0 && nal->data[size - 1] == 0)
>              --size;
> -        av_assert0(size > 0);
> +        if (size == 0)
> +            continue;
>
 I think about this fix have a discussion.
https://patchwork.ffmpeg.org/patch/8919/
>          data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
>          if (!data)


More information about the ffmpeg-devel mailing list