summaryrefslogtreecommitdiff
path: root/libavformat/segment.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/segment.c')
-rw-r--r--libavformat/segment.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 55ba6569f2..3479134ec8 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -351,7 +351,8 @@ static int seg_write_trailer(struct AVFormatContext *s)
if (!seg->write_header_trailer) {
if ((ret = segment_end(oc, 0)) < 0)
goto fail;
- open_null_ctx(&oc->pb);
+ if ((ret = open_null_ctx(&oc->pb)) < 0)
+ goto fail;
ret = av_write_trailer(oc);
close_null_ctx(oc->pb);
} else {