[FFmpeg-devel] [PATCH v2] avcodec/hevc/hevcdec: Do not allow slices to depend on failed slices

Anton Khirnov anton at khirnov.net
Sat Jul 20 09:11:02 EEST 2024


Quoting Michael Niedermayer (2024-07-20 02:08:28)
> On Wed, Jul 17, 2024 at 08:42:41AM +0200, Anton Khirnov wrote:
> > Quoting Michael Niedermayer (2024-07-15 16:48:25)
> [...]
> > > @@ -3155,8 +3156,11 @@ static int decode_slice(HEVCContext *s, const H2645NAL *nal, GetBitContext *gb)
> > >      int ret;
> > >  
> > >      ret = hls_slice_header(&s->sh, s, gb);
> > > -    if (ret < 0)
> > > +    if (ret < 0) {
> > > +        //The code is not capable to rewind from an error, the state now is inconsistant so we cannot use it on depandant slices
> >                                                                                         ^                                ^
> >                                                                                         e                                e
> > Also I'd drop everything before the comma, why mention rewinding that is
> > not implemented and may not be a good idea anyway.
> 
> It seems we disagree on some things.
> A failing function should not corrupt the state. We also dont do that
> in other cases like SPS/PPS.
> This is also unexpected, so it should be documented.

In my view, the root problem is not that the state is corrupted, but
that the independent slice segment is missing. No rewinding you can do
will conjure it out of nowhere, and it's not at all clear to me that
using some random previous slice segment's data is the right thing to
do.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list