[MPlayer-cvslog] r36668 - trunk/libmpdemux/demux_rawdv.c

reimar subversion at mplayerhq.hu
Mon Jan 20 23:08:37 CET 2014


Author: reimar
Date: Mon Jan 20 23:08:37 2014
New Revision: 36668

Log:
demux_rawdv: Fix memory leak on open error.

Modified:
   trunk/libmpdemux/demux_rawdv.c

Modified: trunk/libmpdemux/demux_rawdv.c
==============================================================================
--- trunk/libmpdemux/demux_rawdv.c	Mon Jan 20 23:08:36 2014	(r36667)
+++ trunk/libmpdemux/demux_rawdv.c	Mon Jan 20 23:08:37 2014	(r36668)
@@ -160,12 +160,12 @@ static demuxer_t* demux_open_rawdv(demux
    dv_decoder->quality=DV_QUALITY_BEST;
 
    if (dv_parse_header(dv_decoder, dv_frame) == -1)
-	   return NULL;
+	   goto err_out;
 
    // create a new video stream header
    sh_video = new_sh_video(demuxer, 0);
    if (!sh_video)
-	   return NULL;
+	   goto err_out;
 
    // make sure the demuxer knows about the new video stream header
    // (even though new_sh_video() ought to take care of it)
@@ -230,6 +230,11 @@ static demuxer_t* demux_open_rawdv(demux
    dv_decoder_free(dv_decoder);  //we keep this in the context of both stream headers
    demuxer->priv=frames;
    return demuxer;
+
+err_out:
+   if (dv_decoder) dv_decoder_free(dv_decoder);
+   free(frames);
+   return NULL;
 }
 
 static void demux_close_rawdv(demuxer_t* demuxer)


More information about the MPlayer-cvslog mailing list