# HG changeset patch # User lucabe # Date 1168085485 0 # Node ID 6baa4d2a9cd0673df4474c7ee7a37413e182a2a2 # Parent fa81288982311efe431a38840f1ad8136578a6ad replace some av_malloc();memset(...,0,...) sequences with av_mallocz() diff -r fa8128898231 -r 6baa4d2a9cd0 libswscale/swscale.c --- a/libswscale/swscale.c Sat Jan 06 11:59:33 2007 +0000 +++ b/libswscale/swscale.c Sat Jan 06 12:11:25 2007 +0000 @@ -1245,8 +1245,7 @@ // Note the +1 is for the MMXscaler which reads over the end /* align at 16 for AltiVec (needed by hScale_altivec_real) */ - *outFilter= av_malloc(*outFilterSize*(dstW+1)*sizeof(int16_t)); - memset(*outFilter, 0, *outFilterSize*(dstW+1)*sizeof(int16_t)); + *outFilter= av_mallocz(*outFilterSize*(dstW+1)*sizeof(int16_t)); /* Normalize & Store in outFilter */ for(i=0; isrcW= srcW; c->srcH= srcH; @@ -2276,12 +2274,11 @@ //Note we need at least one pixel more at the end because of the mmx code (just in case someone wanna replace the 4000/8000) /* align at 16 bytes for AltiVec */ for(i=0; ivLumBufSize; i++) - c->lumPixBuf[i]= c->lumPixBuf[i+c->vLumBufSize]= av_malloc(4000); + c->lumPixBuf[i]= c->lumPixBuf[i+c->vLumBufSize]= av_mallocz(4000); for(i=0; ivChrBufSize; i++) c->chrPixBuf[i]= c->chrPixBuf[i+c->vChrBufSize]= av_malloc(8000); //try to avoid drawing green stuff between the right end and the stride end - for(i=0; ivLumBufSize; i++) memset(c->lumPixBuf[i], 0, 4000); for(i=0; ivChrBufSize; i++) memset(c->chrPixBuf[i], 64, 8000); ASSERT(c->chrDstH <= dstH)