diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-03 03:44:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-03 03:44:16 +0200 |
commit | c983ca5b90b80feb65a82678253340992cb54040 (patch) | |
tree | 0f29adc8b8d7680ec767518e910148d8cafda8e5 /libavformat/mpegtsenc.c | |
parent | 328e203ca9b5e5afcd0769dae149075735150346 (diff) | |
download | ffmpeg-c983ca5b90b80feb65a82678253340992cb54040.tar.gz |
mpegtsenc: zero pointers after freeing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r-- | libavformat/mpegtsenc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 9e066dede6..1df804472c 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -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; } } |