[FFmpeg-devel] [PATCH] Make the rtsp_st freeing conditional

Luca Barbato lu_zero
Tue Feb 1 23:54:26 CET 2011


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




More information about the ffmpeg-devel mailing list