r16378 - in trunk/libavformat: rdt.c rmdec.c
Author: rbultje Date: Mon Dec 29 00:23:59 2008 New Revision: 16378 Log: Fix double free which happens for playback of .rm files after r16365. See "rmdec.c: double free" discussion on mailinglist, patch with suggestions from Reimar Doffinger. Modified: trunk/libavformat/rdt.c trunk/libavformat/rmdec.c Modified: trunk/libavformat/rdt.c ============================================================================== --- trunk/libavformat/rdt.c Mon Dec 29 00:12:46 2008 (r16377) +++ trunk/libavformat/rdt.c Mon Dec 29 00:23:59 2008 (r16378) @@ -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); Modified: trunk/libavformat/rmdec.c ============================================================================== --- trunk/libavformat/rmdec.c Mon Dec 29 00:12:46 2008 (r16377) +++ trunk/libavformat/rmdec.c Mon Dec 29 00:23:59 2008 (r16378) @@ -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,
On Mon, Dec 29, 2008 at 12:24:00AM +0100, rbultje wrote:
Author: rbultje Date: Mon Dec 29 00:23:59 2008 New Revision: 16378
Log: Fix double free which happens for playback of .rm files after r16365. See "rmdec.c: double free" discussion on mailinglist, patch with suggestions from Reimar Doffinger.
Modified: trunk/libavformat/rdt.c trunk/libavformat/rmdec.c
Modified: trunk/libavformat/rdt.c ============================================================================== --- trunk/libavformat/rdt.c Mon Dec 29 00:12:46 2008 (r16377) +++ trunk/libavformat/rdt.c Mon Dec 29 00:23:59 2008 (r16378) @@ -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);
this really wasnt part of reimars patch besides it should be av_freep(), as its safer ... [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship naturally arises out of democracy, and the most aggravated form of tyranny and slavery out of the most extreme liberty. -- Plato
Hi, On Sun, Dec 28, 2008 at 6:45 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
On Mon, Dec 29, 2008 at 12:24:00AM +0100, rbultje wrote:
Modified: trunk/libavformat/rdt.c ============================================================================== --- trunk/libavformat/rdt.c Mon Dec 29 00:12:46 2008 (r16377) +++ trunk/libavformat/rdt.c Mon Dec 29 00:23:59 2008 (r16378) @@ -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);
this really wasnt part of reimars patch besides it should be av_freep(), as its safer ...
The structure in which the pointer resides (rdt) disappears in the same function call, so is av_freep() really needed? Ronald
On Sun, Dec 28, 2008 at 07:00:22PM -0500, Ronald S. Bultje wrote:
Hi,
On Sun, Dec 28, 2008 at 6:45 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
On Mon, Dec 29, 2008 at 12:24:00AM +0100, rbultje wrote:
Modified: trunk/libavformat/rdt.c ============================================================================== --- trunk/libavformat/rdt.c Mon Dec 29 00:12:46 2008 (r16377) +++ trunk/libavformat/rdt.c Mon Dec 29 00:23:59 2008 (r16378) @@ -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);
this really wasnt part of reimars patch besides it should be av_freep(), as its safer ...
The structure in which the pointer resides (rdt) disappears in the same function call, so is av_freep() really needed?
no, sorry, ive missed that but the name of the function maybe isnt ideal in this case ... [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I do not agree with what you have to say, but I'll defend to the death your right to say it. -- Voltaire
Hi, On Sun, Dec 28, 2008 at 7:01 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
but the name of the function maybe isnt ideal in this case ...
I was intending to change it from ff_rm_free_rmstream() into ff_rm_close_rmstream() at some point in the future, is that OK? Ronald
participants (3)
-
michaelni@gmx.at -
rsbultje@gmail.com -
subversion@mplayerhq.hu