mirror of
https://github.com/mpv-player/mpv
synced 2024-12-19 05:15:12 +00:00
demux_mkv: fix crash bug introduced by recent change
Commit fc39d48465
("demux_mkv: store streams sequentially in
demuxer->[avs]_streams") had a simple bug in automatic stream
selection causing a crash if no video or audio track was marked as
'default'. Fix.
This commit is contained in:
parent
9b94b3fb30
commit
07e4261aa2
@ -1722,7 +1722,7 @@ static int demux_mkv_open(demuxer_t *demuxer)
|
||||
/* let's take the first video track */
|
||||
for (i = 0; i < mkv_d->num_tracks; i++)
|
||||
if (mkv_d->tracks[i]->type == MATROSKA_TRACK_VIDEO
|
||||
&& track->id >= 0) {
|
||||
&& mkv_d->tracks[i]->id >= 0) {
|
||||
track = mkv_d->tracks[i];
|
||||
break;
|
||||
}
|
||||
@ -1756,7 +1756,7 @@ static int demux_mkv_open(demuxer_t *demuxer)
|
||||
/* let's take the first audio track */
|
||||
for (i = 0; i < mkv_d->num_tracks; i++)
|
||||
if (mkv_d->tracks[i]->type == MATROSKA_TRACK_AUDIO
|
||||
&& track->id >= 0) {
|
||||
&& mkv_d->tracks[i]->id >= 0) {
|
||||
track = mkv_d->tracks[i];
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user