On 2011-12-18 14:50:08 -0800, Ronald S. Bultje wrote:
> Hi,
> 
> On Sun, Dec 18, 2011 at 1:56 PM, Janne Grunau <[email protected]>wrote:
> 
> > ---
> >  libavcodec/h264.c |   10 ++++++----
> >  1 files changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> > index 5d4ce90..0da8ae4 100644
> > --- a/libavcodec/h264.c
> > +++ b/libavcodec/h264.c
> > @@ -173,11 +173,13 @@ const uint8_t *ff_h264_decode_nal(H264Context *h,
> > const uint8_t *src,
> >         if(src[i]) continue;
> >         if(i>0 && src[i-1]==0) i--;
> >  #endif
> > -        if(i+2<length && src[i+1]==0 && src[i+2]<=3){
> > -            if(src[i+2]!=3){
> > +        if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) {
> > +            if (src[i+2] != 3) {
> >                 /* startcode, so we must be past the end */
> > -                length=i;
> > -            }
> > +                length = i;
> > +            } else if (!(src[i+2] & 1))
> > +                av_dlog(h->avctx, "forbidden three byte sequence
> > 0x00000%d\n",
> > +                        src[i+2] & 2);
> >             break;
> >         }
> >
> 
> This just adds a debug-warning right? Probably need to change the commit
> msg. Warning itself is OK.

it also doesn't set length to the start of the imagined start code
prefix. But I think it is still broken behaviour. if anyone has an
annex b sample with start code emulation prevention I'll look at it.
Patch retracted for not.

Janne
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to