Commit b4f300f8 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt Committed by Michael Niedermayer

avformat/matroskaenc: Check functions that can fail

Sometimes it has not been checked whether opening the dynamic buffer for
writing Tags fails; this might have led to segfaults.
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent e934194b
......@@ -1559,7 +1559,9 @@ static int mkv_write_tag_targets(AVFormatContext *s, uint32_t elementid,
ret = mkv_add_seekhead_entry(mkv->seekhead, MATROSKA_ID_TAGS, avio_tell(s->pb));
if (ret < 0) return ret;
start_ebml_master_crc32(s->pb, &mkv->tags_bc, mkv, MATROSKA_ID_TAGS);
ret = start_ebml_master_crc32(s->pb, &mkv->tags_bc, mkv, MATROSKA_ID_TAGS);
if (ret < 0)
return ret;
}
pb = mkv->tags_bc;
......@@ -1655,7 +1657,10 @@ static int mkv_write_tags(AVFormatContext *s)
if (st->codecpar->codec_type == AVMEDIA_TYPE_ATTACHMENT)
continue;
mkv_write_tag_targets(s, MATROSKA_ID_TAGTARGETS_TRACKUID, i + 1, &tag_target);
ret = mkv_write_tag_targets(s, MATROSKA_ID_TAGTARGETS_TRACKUID,
i + 1, &tag_target);
if (ret < 0)
return ret;
pb = mkv->tags_bc;
tag = start_ebml_master(pb, MATROSKA_ID_SIMPLETAG, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment