]> git.sesse.net Git - ffmpeg/commit
avformat/matroskadec: Set offset of first cluster
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 16 May 2019 22:29:51 +0000 (00:29 +0200)
committerJames Almer <jamrial@gmail.com>
Sun, 23 Jun 2019 03:47:50 +0000 (00:47 -0300)
commit43c3cebbd4c09dd4d2f9122b38f23eddfe7cadbe
treec17a5ee3206b86c0ed828f77c025b3909b87e3cd
parent36aceb6174a6a1c40014001ff73c4c30012b569d
avformat/matroskadec: Set offset of first cluster

By default, the data_offset member of the AVFormatInternal of the
AVFormatContext associated with the MatroskaDemuxContext has not been
initialized explicitly by any Matroska-specific function, so that it was
initialized by default to the offset at the end of matroska_read_header,
i.e. usually to the offset of the length field of the first encountered
cluster. This meant that in case that the Matroska-specific seek-code
fails because there are no index entries for the target track a seek to
data_offset would be performed and ordinary parsing would start from
there which is nonsense: The length field would be treated as EBML ID and
(if the length field is not longer than four bytes (EBML numbers that
long are rejected as invalid EBML IDs)) whatever comes next would be
treated as its EBML size although it simply isn't.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/matroskadec.c