Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 3cf4296f8d..938ba2cdb2 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3563,13 +3563,16 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf
size -= n;
track = matroska_find_track_by_num(matroska, num);
- if (!track || !track->stream) {
- av_log(matroska->ctx, AV_LOG_INFO,
- "Invalid stream %"PRIu64"\n", num);
+ if (!track || size < 3)
return AVERROR_INVALIDDATA;
- } else if (size < 3)
- return AVERROR_INVALIDDATA;
- st = track->stream;
+
+ if (!(st = track->stream)) {
+ av_log(matroska->ctx, AV_LOG_VERBOSE,
+ "No stream associated to TrackNumber %"PRIu64". "
+ "Ignoring Block with this TrackNumber.\n", num);
+ return 0;
+ }
+
if (st->discard >= AVDISCARD_ALL)
return res;
av_assert1(block_duration != AV_NOPTS_VALUE);