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:
Ben Boeckel 2013-09-26 20:42:09 -04:00 committed by wm4
parent 2970352b25
commit 9f149717a6
1 changed files with 5 additions and 5 deletions

View File

@ -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. "