diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-01-07 22:29:16 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-01-07 22:29:16 +0100 |
commit | e2404096b02e8ccba4979ec5ba2399ff5143187b (patch) | |
tree | fe2165da0143f2e38a0631b5070837fca42b70cd /libavformat/segment.c | |
parent | 2a741baeff359aa7e8a5bb2c1a225d6ac9cf10ee (diff) | |
download | ffmpeg-e2404096b02e8ccba4979ec5ba2399ff5143187b.tar.gz |
avformat/segment: Clear contexts after deallocation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/segment.c')
-rw-r--r-- | libavformat/segment.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c index 1aac5817c4..0ee65bba92 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -357,7 +357,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last) av_freep(&entry); } - avio_close(seg->list_pb); + avio_closep(&seg->list_pb); if ((ret = segment_list_open(s)) < 0) goto end; for (entry = seg->segment_list_entries; entry; entry = entry->next) @@ -375,7 +375,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last) seg->segment_count++; end: - avio_close(oc->pb); + avio_closep(&oc->pb); return ret; } @@ -688,7 +688,7 @@ static int seg_write_header(AVFormatContext *s) } if (ret < 0) { - avio_close(oc->pb); + avio_closep(&oc->pb); goto fail; } seg->segment_frame_count = 0; @@ -849,7 +849,7 @@ static int seg_write_trailer(struct AVFormatContext *s) } fail: if (seg->list) - avio_close(seg->list_pb); + avio_closep(&seg->list_pb); av_dict_free(&seg->format_options); av_opt_free(seg); @@ -865,6 +865,7 @@ fail: } avformat_free_context(oc); + seg->avf = NULL; return ret; } |