1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 08:12:17 +00:00

demux_mkv: avoid hang with some broken files

Return failure to open file in one case that could lead to an infinite
loop with broken Matroska files before.
This commit is contained in:
Uoti Urpala 2011-09-25 18:35:09 +03:00
parent eb66a3fe07
commit c9e681fca3

View File

@ -1676,6 +1676,10 @@ static int demux_mkv_open(demuxer_t *demuxer)
while (1) {
uint32_t id = ebml_read_id(s, NULL);
if (s->eof) {
mp_tmsg(MSGT_DEMUX, MSGL_ERR, "[mkv] Unexpected end of file\n");
return 0;
}
if (id == MATROSKA_ID_CLUSTER) {
mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] |+ found cluster, headers are "
"parsed completely :)\n");