[FFmpeg-devel] [PATCH] Make the rtsp_st freeing conditional
Ronald S. Bultje
rsbultje
Wed Feb 2 00:04:52 CET 2011
Hi,
On Feb 1, 2011, at 5:54 PM, Luca Barbato <lu_zero at gentoo.org> wrote:
> On non mpegts in rtp the same memory is also pointed by st->priv_data,
> thus freed automatically.
>
> Fixes the double free introduced in 7cd3fa8e3248b2c83ab131d386fb7b24705034cb
> ---
> libavformat/rtsp.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index 09e2f1e..1386e30 100644
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -532,7 +532,8 @@ void ff_rtsp_close_streams(AVFormatContext *s)
> if (rtsp_st->dynamic_handler && rtsp_st->dynamic_protocol_context)
> rtsp_st->dynamic_handler->close(
> rtsp_st->dynamic_protocol_context);
> - av_free(rtsp_st);
> + if(!strcmp(ff_rtp_enc_name(rtsp_st->sdp_payload_type), "MP2T"))
> + av_free(rtsp_st);
> }
> }
> av_free(rt->rtsp_streams);
> --
> 1.7.2.2
av_freep() doesn't help? What about av_freep()in utils.c also?
Ronald
More information about the ffmpeg-devel
mailing list