]> git.sesse.net Git - ffmpeg/commit
matroskadec: verify seekhead IDs
authorwm4 <nfxjfg@googlemail.com>
Fri, 12 Jun 2015 11:11:41 +0000 (13:11 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Jun 2015 17:30:11 +0000 (19:30 +0200)
commit7e240f95818310ed721321e62130aa1c69f9cbe6
tree727903485eae6da6a628ffec04ce545b08e163a1
parentcfe8a89b0087d08b73f1fec850b1a972f82388bb
matroskadec: verify seekhead IDs

Some files have SeekHead elements with broken IDs. They mismatch with
the ID of the destination element. These files are written by
"IDMmkvlib0.1" (as identified by the MuxingApp and WritingApp elements),
and the SeekHead IDs are actually endian-swapped.

This confuses the SeekHead logic of the demuxer. It will read some
elements twice, because the SeekHead ID is used to identify and remember
already read elements. With the file at hand, the stream list was
duplicated by reading the Tracks element twice.

Fix this by rejecting invalid EBML IDs in SeekHead entries. (This fix is
relatively specific to the broken file at hand, and doesn't protect
against some other cases of broken SeekHead, such as valid but
mismatching target element IDs.)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/matroskadec.c