Commit a2ab8bab authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avformat/matroskadec: Fix handling gigantic durations

matroska_parse_block currently asserts that the duration is not equal to
AV_NOPTS_VALUE, but there is nothing that actually guarantees this. It
is easy to create (spec-compliant) files which run into this assert;
so replace it and instead cap the duration to INT64_MAX, as the duration
field of an AVPacket is an int64_t.
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 3714d452b894821591a2fbafdd1b8ef15abe4be6)
parent 751f2851
...@@ -3568,7 +3568,8 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf ...@@ -3568,7 +3568,8 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf
if (st->discard >= AVDISCARD_ALL) if (st->discard >= AVDISCARD_ALL)
return res; return res;
av_assert1(block_duration != AV_NOPTS_VALUE); if (block_duration > INT64_MAX)
block_duration = INT64_MAX;
block_time = sign_extend(AV_RB16(data), 16); block_time = sign_extend(AV_RB16(data), 16);
data += 2; data += 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment