summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-24 21:15:43 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-24 21:15:43 +0000
commit0f4d83ce51fc4404381170f3181cd50c7ed917c1 (patch)
tree802cecfa1fa5b056f9495c98136817399408c33e
parent2e50d88ab2e5eb637abe5c4d5af244f52929ad31 (diff)
downloadmpv-0f4d83ce51fc4404381170f3181cd50c7ed917c1.tar.bz2
mpv-0f4d83ce51fc4404381170f3181cd50c7ed917c1.tar.xz
Use av_malloc to ensure sufficient alignment and also free at least some
of the allocated memory. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30430 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--gui/bitmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gui/bitmap.c b/gui/bitmap.c
index f0377959a5..b61c3c90cf 100644
--- a/gui/bitmap.c
+++ b/gui/bitmap.c
@@ -45,7 +45,7 @@ static int pngRead( unsigned char * fname,txSample * bf )
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 * fname,txSample * bf )
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 );