From 28c020d4df9b060a58a124a7a5406d4313fbe249 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Fri, 24 Oct 2014 00:05:55 +0100 Subject: [PATCH] matroskaenc: check avio_open_dyn_buf return value CC: libav-stable@libav.org Bug-Id: CID 703629 --- libavformat/matroskaenc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index f057c0755a..ed6817099f 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1443,8 +1443,11 @@ static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt) ts += mkv->tracks[pkt->stream_index].ts_offset; if (!s->pb->seekable) { - if (!mkv->dyn_bc) - avio_open_dyn_buf(&mkv->dyn_bc); + if (!mkv->dyn_bc) { + ret = avio_open_dyn_buf(&mkv->dyn_bc); + if (ret < 0) + return ret; + } pb = mkv->dyn_bc; }