Merge "muxer: Reject file if TrackType is never specified"

This commit is contained in:
Vignesh Venkatasubramanian 2014-04-29 00:18:55 -07:00 committed by Gerrit Code Review
commit 9097a0691b

View File

@ -619,6 +619,10 @@ bool Track::Write(IMkvWriter* writer) const {
if (!WriteEbmlMasterElement(writer, kMkvTrackEntry, payload_size))
return false;
// |type_| has to be specified before the Track can be written.
if (!type_)
return false;
uint64 size = EbmlElementSize(kMkvTrackNumber, number_);
size += EbmlElementSize(kMkvTrackUID, uid_);
size += EbmlElementSize(kMkvTrackType, type_);