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:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-08-30 16:18:29 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-03 14:48:05 +0300
commitb5e9226dad0e9038fbadb1e377a1ac29b4711ca6 (patch)
treed028bf98b9c2611fbc30a59043664607ccdcf442
parentc6ee2f7c90aadf200eba53508f3fe15bc25e0c82 (diff)
avformat/matroskadec: Use right number of tracks
When demuxing a Matroska/WebM file, streams are added for tracks and for attachments, so that the array containing the former can be NULL even when the corresponding AVFormatContext has streams. So check for there to be tracks in the MatroskaDemuxContext instead of just streams in the AVFormatContext before dereferencing the pointer to the tracks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit 1ef30571a0a7150cb20c580bfc52af2a7101c20d) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavformat/matroskadec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 401139e27c..6cf172313a 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3895,9 +3895,9 @@ static int webm_dash_manifest_read_header(AVFormatContext *s)
av_log(s, AV_LOG_ERROR, "Failed to read file headers\n");
return -1;
}
- if (!s->nb_streams) {
+ if (!matroska->tracks.nb_elem || !s->nb_streams) {
matroska_read_close(s);
- av_log(s, AV_LOG_ERROR, "No streams found\n");
+ av_log(s, AV_LOG_ERROR, "No track found\n");
return AVERROR_INVALIDDATA;
}