webm_info,OutputCues: fix indexing of tracks

use GetTrackByIndex() rather than GetTrackByNumber(). the former is
0-based the latter is by track id, this loop iterates through all tracks
based on the track count.
fixes a segfault with tracks non-starting at 1 / increasing by 1.

BUG=webm:1415

Change-Id: I916328575d0871cf4090b1d123644d6f01e6ffb1
This commit is contained in:
James Zern 2017-04-19 23:10:33 -07:00
parent a0d27f0d51
commit 50c44bb44d

View File

@ -1085,8 +1085,8 @@ bool OutputCues(const mkvparser::Segment& segment,
indent->Adjust(libwebm::kIncreaseIndent);
do {
for (int track_num = 1; track_num <= num_tracks; ++track_num) {
const mkvparser::Track* const track = tracks.GetTrackByNumber(track_num);
for (int track_num = 0; track_num < num_tracks; ++track_num) {
const mkvparser::Track* const track = tracks.GetTrackByIndex(track_num);
const mkvparser::CuePoint::TrackPosition* const track_pos =
cue_point->Find(track);
@ -1095,7 +1095,7 @@ bool OutputCues(const mkvparser::Segment& segment,
(track->GetType() == mkvparser::Track::kVideo) ? 'V' : 'A';
fprintf(o, "%sCue Point:%d type:%c track:%d",
indent->indent_str().c_str(), cue_point_num, track_type,
track_num);
static_cast<int>(track->GetNumber()));
if (options.output_seconds) {
fprintf(o, " secs:%g",