On Wed, Jul 13, 2011 at 01:33:58PM +0100, Måns Rullgård wrote:
> Diego Biurrun <[email protected]> writes:
> 
> > On Wed, Jul 13, 2011 at 12:54:46PM +0100, Mans Rullgard wrote:
> >> These buffers have int16_t elements so the padding at the end needs
> >> to be two bytes, not one.
> >> 
> >> --- a/libswscale/utils.c
> >> +++ b/libswscale/utils.c
> >> @@ -1045,19 +1045,19 @@ int sws_init_context(SwsContext *c, SwsFilter 
> >> *srcFilter, SwsFilter *dstFilter)
> >>      /* align at 16 bytes for AltiVec */
> >>      for (i=0; i<c->vLumBufSize; i++) {
> >> -        FF_ALLOCZ_OR_GOTO(c, c->lumPixBuf[i+c->vLumBufSize], 
> >> dst_stride+1, fail);
> >> +        FF_ALLOCZ_OR_GOTO(c, c->lumPixBuf[i+c->vLumBufSize], 
> >> dst_stride+2, fail);
> >
> > Could this be done with sizeof or similar instead of magic numbers?
> 
> I guess sizeof(c->lumPixBuf[0]) would work.  It's a bit of a mouthful though.

Yes, it's longish, but I think the magic number gave rise to the bug
in the first place, so I thought I'd raise the point.

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

Reply via email to