[libav-stable] matroskaenc: check avio_open_dyn_buf return value

Vittorio Giovara git at libav.org
Sat Oct 25 00:51:54 CEST 2014


Module: libav
Branch: master
Commit: 28c020d4df9b060a58a124a7a5406d4313fbe249

Author:    Vittorio Giovara <vittorio.giovara at gmail.com>
Committer: Vittorio Giovara <vittorio.giovara at gmail.com>
Date:      Fri Oct 24 00:05:55 2014 +0100

matroskaenc: check avio_open_dyn_buf return value

CC: libav-stable at 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 f057c07..ed68170 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;
     }
 



More information about the libav-stable mailing list