demux_mkv: error if needed compression settings were not found

Mode 3 is header stripping and we need ContentCompSettings to
reconstruct the data.

Found by fuzzing.
This commit is contained in:
Kacper Michajłow 2024-01-28 04:19:36 +01:00 committed by Dudemanguy
parent 4419e5c41b
commit 5e54a871c5
1 changed files with 4 additions and 0 deletions

View File

@ -390,6 +390,10 @@ static bstr demux_mkv_decode(struct mp_log *log, mkv_track_t *track,
}
size = dstlen - out_avail;
} else if (enc->comp_algo == 3) {
if (enc->comp_settings_len == 0 || !enc->comp_settings) {
mp_warn(log, "missing comp_settings, unable to reconstruct the data.\n");
goto error;
}
dest = talloc_size(track->parser_tmp, size + enc->comp_settings_len);
memcpy(dest, enc->comp_settings, enc->comp_settings_len);
memcpy(dest + enc->comp_settings_len, src, size);