matroskaenc: check avio_open_dyn_buf return value
authorVittorio Giovara <vittorio.giovara@gmail.com>
Thu, 23 Oct 2014 23:05:55 +0000 (00:05 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Fri, 24 Oct 2014 22:48:57 +0000 (23:48 +0100)
CC: libav-stable@libav.org
Bug-Id: CID 703629

libavformat/matroskaenc.c

index f057c07..ed68170 100644 (file)
@@ -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;
     }