mkvmuxer: Reject frames if invalid track number is passed.
Reject frames if an invalid track number is passed. Also change sample_muxer to reject files which have Block elements with invalid track numbers. Fixes Issue #659: https://code.google.com/p/webm/issues/detail?id=659 Change-Id: Ie6cf39a409b68bb4d2261f308409ee0c36d5dd8e
This commit is contained in:
@@ -457,6 +457,14 @@ int main(int argc, char* argv[]) {
|
||||
const long long trackNum = block->GetTrackNumber();
|
||||
const mkvparser::Track* const parser_track =
|
||||
parser_tracks->GetTrackByNumber(static_cast<unsigned long>(trackNum));
|
||||
|
||||
// When |parser_track| is NULL, it means that the track number in the
|
||||
// Block is invalid (i.e.) the was no TrackEntry corresponding to the
|
||||
// track number. So we reject the file.
|
||||
if (!parser_track) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
const long long track_type = parser_track->GetType();
|
||||
const long long time_ns = block->GetTime(cluster);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user