Mercurial > mplayer.hg
changeset 23200:44cf48083874
Use calloc instead of malloc+memset
author | reimar |
---|---|
date | Wed, 02 May 2007 16:42:31 +0000 |
parents | e1d0d26f5e3c |
children | 96ac0beace61 |
files | gui/bitmap.c |
diffstat | 1 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/bitmap.c Wed May 02 16:39:35 2007 +0000 +++ b/gui/bitmap.c Wed May 02 16:42:31 2007 +0000 @@ -74,13 +74,12 @@ tmpImage=bf->Image; bf->ImageSize=bf->Width * bf->Height * 4; bf->BPP=32; - if ( ( bf->Image=malloc( bf->ImageSize ) ) == NULL ) + if ( ( bf->Image=calloc( 1, bf->ImageSize ) ) == NULL ) { free( tmpImage ); mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] not enough memory for image\n" ); return 1; } - memset( bf->Image,0,bf->ImageSize ); for ( c=0,i=0; c < bf->ImageSize; ) { bf->Image[c++]=tmpImage[i++]; //red