Browse Source

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: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 3714d452b8)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
tags/n4.0.6
Andreas Rheinhardt 6 years ago
parent
commit
eb4bae9a1c
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavformat/matroskadec.c

+ 2
- 1
libavformat/matroskadec.c View File

@@ -3331,7 +3331,8 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf
st = track->stream;
if (st->discard >= AVDISCARD_ALL)
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);
data += 2;


Loading…
Cancel
Save