demux_mkv: fix a hang with invalid files
commite54f11100577b73bc19f62a06c0ffca56035a194
authorUoti Urpala <uau@mplayer2.org>
Mon, 29 Oct 2012 17:58:35 +0000 (29 19:58 +0200)
committerUoti Urpala <uau@mplayer2.org>
Mon, 29 Oct 2012 17:58:35 +0000 (29 19:58 +0200)
tree6b51f6e3dc5de8bd0db2bfe5a5a257abded2bf39
parent2cce02bbd45716d74402d125444f021d30c35457
demux_mkv: fix a hang with invalid files

ebml_read_length() could return a negative value (as uint64_t though)
at EOF, and this would then make ebml_read_skip() seek backwards. This
could lead to an infinite loop at EOF with corrupt files. Add an extra
check to make ebml_read_length() return EBML_UINT_INVALID instead if
EOF is hit in the middle of parsing.
libmpdemux/ebml.c