mirror of https://github.com/mpv-player/mpv
matroska: prevent uids from being dereferenced when NULL
The old code prevented it since uids being NULL makes a 0 talloc length. Now that we're iterating over a specific length, NULL can be dereferenced.
This commit is contained in:
parent
2970352b25
commit
9f149717a6
|
@ -392,11 +392,11 @@ static int demux_mkv_read_info(demuxer_t *demuxer)
|
|||
}
|
||||
if (demuxer->params && demuxer->params->matroska_wanted_uids) {
|
||||
unsigned char (*uids)[16] = demuxer->params->matroska_wanted_uids;
|
||||
if (!info.n_segment_uid)
|
||||
uids = NULL;
|
||||
for (int i = 0; i < demuxer->params->matroska_num_wanted_uids; i++) {
|
||||
if (!memcmp(info.segment_uid.start, uids[i], 16))
|
||||
goto out;
|
||||
if (info.n_segment_uid) {
|
||||
for (int i = 0; i < demuxer->params->matroska_num_wanted_uids; i++) {
|
||||
if (!memcmp(info.segment_uid.start, uids[i], 16))
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
mp_tmsg(MSGT_DEMUX, MSGL_INFO,
|
||||
"[mkv] This is not one of the wanted files. "
|
||||
|
|
Loading…
Reference in New Issue