[MPlayer-cvslog] r30430 - trunk/gui/bitmap.c

reimar subversion at mplayerhq.hu
Sun Jan 24 22:15:43 CET 2010


Author: reimar
Date: Sun Jan 24 22:15:43 2010
New Revision: 30430

Log:
Use av_malloc to ensure sufficient alignment and also free at least some
of the allocated memory.

Modified:
   trunk/gui/bitmap.c

Modified: trunk/gui/bitmap.c
==============================================================================
--- trunk/gui/bitmap.c	Sun Jan 24 21:54:17 2010	(r30429)
+++ trunk/gui/bitmap.c	Sun Jan 24 22:15:43 2010	(r30430)
@@ -45,7 +45,7 @@ static int pngRead( unsigned char * fnam
  fseek(fp, 0, SEEK_END);
  len = ftell(fp);
  if (len > 50 * 1024 * 1024) return 2;
- data = malloc(len + FF_INPUT_BUFFER_PADDING_SIZE);
+ data = av_malloc(len + FF_INPUT_BUFFER_PADDING_SIZE);
  fseek(fp, 0, SEEK_SET);
  fread(data, len, 1, fp);
  fclose(fp);
@@ -74,6 +74,7 @@ static int pngRead( unsigned char * fnam
  avcodec_close(avctx);
  av_freep(&frame);
  av_freep(&avctx);
+ av_freep(&data);
 
  mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] filename: %s.\n",fname );
  mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png]  size: %dx%d bits: %d\n",bf->Width,bf->Height,bf->BPP );


More information about the MPlayer-cvslog mailing list