Mercurial > mplayer.hg
diff libmpcodecs/vf_unsharp.c @ 31003:00825525514e
Replace memalign(x) (x > 8) by av_malloc() to prevent crashes on systems
lacking memalign(), e.g. Win32.
author | zuxy |
---|---|
date | Tue, 20 Apr 2010 04:33:00 +0000 |
parents | 8a96d56b01f0 |
children | 8fa2f43cb760 |
line wrap: on
line diff
--- a/libmpcodecs/vf_unsharp.c Sat Apr 17 02:19:34 2010 +0000 +++ b/libmpcodecs/vf_unsharp.c Tue Apr 20 04:33:00 2010 +0000 @@ -143,7 +143,7 @@ stepsX = fp->msizeX/2; stepsY = fp->msizeY/2; for( z=0; z<2*stepsY; z++ ) - fp->SC[z] = memalign( 16, sizeof(*(fp->SC[z])) * (width+2*stepsX) ); + fp->SC[z] = av_malloc(sizeof(*(fp->SC[z])) * (width+2*stepsX)); fp = &vf->priv->chromaParam; effect = fp->amount == 0 ? "don't touch" : fp->amount < 0 ? "blur" : "sharpen"; @@ -152,7 +152,7 @@ stepsX = fp->msizeX/2; stepsY = fp->msizeY/2; for( z=0; z<2*stepsY; z++ ) - fp->SC[z] = memalign( 16, sizeof(*(fp->SC[z])) * (width+2*stepsX) ); + fp->SC[z] = av_malloc(sizeof(*(fp->SC[z])) * (width+2*stepsX)); return vf_next_config( vf, width, height, d_width, d_height, flags, outfmt ); } @@ -212,12 +212,12 @@ fp = &vf->priv->lumaParam; for( z=0; z<sizeof(fp->SC)/sizeof(fp->SC[0]); z++ ) { - if( fp->SC[z] ) free( fp->SC[z] ); + if( fp->SC[z] ) av_free( fp->SC[z] ); fp->SC[z] = NULL; } fp = &vf->priv->chromaParam; for( z=0; z<sizeof(fp->SC)/sizeof(fp->SC[0]); z++ ) { - if( fp->SC[z] ) free( fp->SC[z] ); + if( fp->SC[z] ) av_free( fp->SC[z] ); fp->SC[z] = NULL; }