summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-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 );