提交 ce41c51b 编写于 作者: M Martin Storsjö 提交者: Luca Barbato

Free AVStream->info in chained muxers

This fixes memory leaks in the RTSP muxer and RTP hinting in the
mov muxer present since SVN rev 25418.
Signed-off-by: NLuca Barbato <lu_zero@gentoo.org>
上级 d9c0510e
...@@ -86,6 +86,7 @@ fail: ...@@ -86,6 +86,7 @@ fail:
} }
if (track->rtp_ctx && track->rtp_ctx->streams[0]) { if (track->rtp_ctx && track->rtp_ctx->streams[0]) {
av_metadata_free(&track->rtp_ctx->streams[0]->metadata); av_metadata_free(&track->rtp_ctx->streams[0]->metadata);
av_free(track->rtp_ctx->streams[0]->info);
av_free(track->rtp_ctx->streams[0]); av_free(track->rtp_ctx->streams[0]);
} }
if (track->rtp_ctx) { if (track->rtp_ctx) {
...@@ -490,6 +491,7 @@ void ff_mov_close_hinting(MOVTrack *track) { ...@@ -490,6 +491,7 @@ void ff_mov_close_hinting(MOVTrack *track) {
} }
av_metadata_free(&rtp_ctx->streams[0]->metadata); av_metadata_free(&rtp_ctx->streams[0]->metadata);
av_metadata_free(&rtp_ctx->metadata); av_metadata_free(&rtp_ctx->metadata);
av_free(rtp_ctx->streams[0]->info);
av_free(rtp_ctx->streams[0]); av_free(rtp_ctx->streams[0]);
av_freep(&rtp_ctx); av_freep(&rtp_ctx);
} }
......
...@@ -70,6 +70,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, ...@@ -70,6 +70,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
url_close_dyn_buf(rtpctx->pb, &ptr); url_close_dyn_buf(rtpctx->pb, &ptr);
av_free(ptr); av_free(ptr);
} }
av_free(rtpctx->streams[0]->info);
av_free(rtpctx->streams[0]); av_free(rtpctx->streams[0]);
av_free(rtpctx); av_free(rtpctx);
return NULL; return NULL;
......
...@@ -500,6 +500,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s) ...@@ -500,6 +500,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s)
} }
av_metadata_free(&rtpctx->streams[0]->metadata); av_metadata_free(&rtpctx->streams[0]->metadata);
av_metadata_free(&rtpctx->metadata); av_metadata_free(&rtpctx->metadata);
av_free(rtpctx->streams[0]->info);
av_free(rtpctx->streams[0]); av_free(rtpctx->streams[0]);
av_free(rtpctx); av_free(rtpctx);
} else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC) } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册