[FFmpeg-devel] [HACK] fix issue 944

Reimar Döffinger Reimar.Doeffinger
Sun Apr 12 09:51:41 CEST 2009


On Sun, Apr 12, 2009 at 05:08:46AM +0200, Michael Niedermayer wrote:
> On Fri, Apr 10, 2009 at 01:24:33PM +0200, Reimar D?ffinger wrote:
> > Hello,
> > the file in issue 944 causes mb_xy to become something around -300 and
> > then crashes.
> > Attached patch fixes this the brute-force way, for a better fix I'd need
> > hints where to look.
> 
> > Index: libavcodec/h264.c
> > ===================================================================
> > --- libavcodec/h264.c	(revision 18407)
> > +++ libavcodec/h264.c	(working copy)
> > @@ -1005,6 +1005,7 @@
> >          }else if(!(s->picture_structure & h->ref_list[1][0].reference) && !h->ref_list[1][0].mbaff){// FL -> FL & differ parity
> >              int fieldoff= 2*(h->ref_list[1][0].reference)-3;
> >              mb_xy += s->mb_stride*fieldoff;
> > +            mb_xy = FFMAX(mb_xy, 0);
> 
> how does it become -300 ?
> reference should never become anything outside 0..7
> am i right in the assumtation that reference is outside that range?

I will check again some time, but I think not.
IIRC mb_xy is 0 at the start of the if, and fieldoff is -1, and thus
mb_xy becomes -s->mb_stride.



More information about the ffmpeg-devel mailing list