[MPlayer-cvslog] r35379 - trunk/libmpdemux/demux_mf.c

reimar subversion at mplayerhq.hu
Sat Nov 10 13:07:28 CET 2012


Author: reimar
Date: Sat Nov 10 13:07:28 2012
New Revision: 35379

Log:
Fix memleak when reading a file fails.

Modified:
   trunk/libmpdemux/demux_mf.c

Modified: trunk/libmpdemux/demux_mf.c
==============================================================================
--- trunk/libmpdemux/demux_mf.c	Sat Nov 10 13:03:26 2012	(r35378)
+++ trunk/libmpdemux/demux_mf.c	Sat Nov 10 13:07:28 2012	(r35379)
@@ -61,7 +61,11 @@ static int demux_mf_fill_buffer(demuxer_
   {
    sh_video_t     * sh_video = demuxer->video->sh;
    demux_packet_t * dp = new_demux_packet( fs.st_size );
-   if ( !fread( dp->buffer,fs.st_size,1,f ) ) return 0;
+   if ( !fread( dp->buffer,fs.st_size,1,f ) ) {
+        fclose(f);
+        free_demux_packet(dp);
+        return 0;
+   }
    dp->pts=mf->curr_frame / sh_video->fps;
    dp->pos=mf->curr_frame;
    dp->flags=1;


More information about the MPlayer-cvslog mailing list