Fix double free which happens for playback of .rm files after r16365. See
authorRonald S. Bultje <rsbultje@gmail.com>
Sun, 28 Dec 2008 23:23:59 +0000 (23:23 +0000)
committerRonald S. Bultje <rsbultje@gmail.com>
Sun, 28 Dec 2008 23:23:59 +0000 (23:23 +0000)
"rmdec.c: double free" discussion on mailinglist, patch with suggestions
from Reimar Doffinger.

Originally committed as revision 16378 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/rdt.c
libavformat/rmdec.c

index a3e468d..6ed1137 100644 (file)
@@ -438,6 +438,7 @@ static void
 rdt_free_extradata (PayloadContext *rdt)
 {
     ff_rm_free_rmstream(rdt->rmst[0]);
+    av_free(rdt->rmst[0]);
     if (rdt->rmctx)
         av_close_input_stream(rdt->rmctx);
     av_freep(&rdt->mlti_data);
index e8ecc92..01e335b 100644 (file)
@@ -83,7 +83,6 @@ void ff_rm_free_rmstream (RMStream *rms)
 {
     av_free(rms->videobuf);
     av_free(rms->audiobuf);
-    av_free(rms);
 }
 
 static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb,