summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-01-27 09:28:19 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-28 17:18:27 +0100
commit43f58f2354bfab3819e44c1a97b0af75cc091226 (patch)
tree79dafd0377e69272f332407cd51d9f19ddf842eb /libavformat/mov.c
parent3999c4b374c2f3786137bd7e820dd1555fc20d90 (diff)
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>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b9e32874c4..3a183ed015 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;