提交 c983ca5b 编写于 作者: M Michael Niedermayer

mpegtsenc: zero pointers after freeing

Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 328e203c
......@@ -723,9 +723,10 @@ static int mpegts_write_header(AVFormatContext *s)
if (ts_st) {
av_freep(&ts_st->payload);
if (ts_st->amux) {
av_free(ts_st->amux->pb->buffer);
av_free(ts_st->amux->pb);
av_freep(&ts_st->amux->pb->buffer);
av_freep(&ts_st->amux->pb);
avformat_free_context(ts_st->amux);
ts_st->amux = NULL;
}
}
av_freep(&st->priv_data);
......@@ -1235,9 +1236,10 @@ static int mpegts_write_end(AVFormatContext *s)
MpegTSWriteStream *ts_st = st->priv_data;
av_freep(&ts_st->payload);
if (ts_st->amux) {
av_free(ts_st->amux->pb->buffer);
av_free(ts_st->amux->pb);
av_freep(&ts_st->amux->pb->buffer);
av_freep(&ts_st->amux->pb);
avformat_free_context(ts_st->amux);
ts_st->amux = NULL;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册