changeset 2502:3230f4c53b17 libavformat

Always check the return of mkv_add_seekhead_entry
author conrad
date Wed, 05 Sep 2007 00:25:34 +0000
parents b91eb35b1237
children 9b43d21cc638
files matroskaenc.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/matroskaenc.c	Wed Sep 05 00:25:32 2007 +0000
+++ b/matroskaenc.c	Wed Sep 05 00:25:34 2007 +0000
@@ -754,14 +754,17 @@
     MatroskaMuxContext *mkv = s->priv_data;
     ByteIOContext *pb = &s->pb;
     offset_t currentpos, second_seekhead, cuespos;
+    int ret;
 
     end_ebml_master(pb, mkv->cluster);
 
     cuespos = mkv_write_cues(pb, mkv->cues, s->nb_streams);
     second_seekhead = mkv_write_seekhead(pb, mkv->cluster_seekhead);
 
-    mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CUES    , cuespos);
-    mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_SEEKHEAD, second_seekhead);
+    ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CUES    , cuespos);
+    if (ret < 0) return ret;
+    ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_SEEKHEAD, second_seekhead);
+    if (ret < 0) return ret;
     mkv_write_seekhead(pb, mkv->main_seekhead);
 
     // update the duration