OSDN Git Service

Free AVStream->info in chained muxers
authorMartin Storsjö <martin@martin.st>
Wed, 2 Feb 2011 08:57:26 +0000 (10:57 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Thu, 3 Feb 2011 00:03:31 +0000 (01:03 +0100)
This fixes memory leaks in the RTSP muxer and RTP hinting in the
mov muxer present since SVN rev 25418.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavformat/movenchint.c
libavformat/rtpenc_chain.c
libavformat/rtsp.c

index 2ebe8b8..2aa0f17 100644 (file)
@@ -86,6 +86,7 @@ fail:
     }
     if (track->rtp_ctx && track->rtp_ctx->streams[0]) {
         av_metadata_free(&track->rtp_ctx->streams[0]->metadata);
+        av_free(track->rtp_ctx->streams[0]->info);
         av_free(track->rtp_ctx->streams[0]);
     }
     if (track->rtp_ctx) {
@@ -490,6 +491,7 @@ void ff_mov_close_hinting(MOVTrack *track) {
     }
     av_metadata_free(&rtp_ctx->streams[0]->metadata);
     av_metadata_free(&rtp_ctx->metadata);
+    av_free(rtp_ctx->streams[0]->info);
     av_free(rtp_ctx->streams[0]);
     av_freep(&rtp_ctx);
 }
index 10d9df2..19ea98f 100644 (file)
@@ -70,6 +70,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
             url_close_dyn_buf(rtpctx->pb, &ptr);
             av_free(ptr);
         }
+        av_free(rtpctx->streams[0]->info);
         av_free(rtpctx->streams[0]);
         av_free(rtpctx);
         return NULL;
index e1d7503..52c686c 100644 (file)
@@ -500,6 +500,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s)
                 }
                 av_metadata_free(&rtpctx->streams[0]->metadata);
                 av_metadata_free(&rtpctx->metadata);
+                av_free(rtpctx->streams[0]->info);
                 av_free(rtpctx->streams[0]);
                 av_free(rtpctx);
             } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)