aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-01-27 09:28:19 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-20 10:51:29 +0200
commitfa7d8d63db11fa7eaaf60dc7f6573612f5f3ff98 (patch)
treef7e03c94071c41e708dcb54bc7407485127fb4eb
parent09d2b9b7bedb1e95a5aa365794c02fb5dd183025 (diff)
downloadffmpeg-fa7d8d63db11fa7eaaf60dc7f6573612f5f3ff98.tar.gz
avformat/mov: Don't leak MOVFragmentStreamInfo on error
Fixes Coverity issue #1441933. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 43f58f2354bfab3819e44c1a97b0af75cc091226)
-rw-r--r--libavformat/mov.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 0a9abaa795..e57e7444a6 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1327,8 +1327,10 @@ static int update_frag_index(MOVContext *c, int64_t offset)
for (i = 0; i < c->fc->nb_streams; i++) {
// Avoid building frag index if streams lack track id.
- if (c->fc->streams[i]->id < 0)
+ if (c->fc->streams[i]->id < 0) {
+ av_free(frag_stream_info);
return AVERROR_INVALIDDATA;
+ }
frag_stream_info[i].id = c->fc->streams[i]->id;
frag_stream_info[i].sidx_pts = AV_NOPTS_VALUE;