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

Aman Gupta aman at tmm1.net
Fri Oct 12 08:26:48 EEST 2018


On Thu, Oct 11, 2018 at 10:03 PM mypopy at gmail.com <mypopy at gmail.com> wrote:

> 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/


Thanks for the link. It looks like this issue was resolved
in 9a09f4c54ab829811c2dd041cfb7196000590b78

I will backport commit that to the release/4.0 branch.

<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