aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-01-27 09:28:18 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-01 23:15:45 +0200
commit7a13d99e6e350afe79b17382f7ac293bb4eef3c9 (patch)
tree2be3d43a7aa66dbceacee7c963d3ad3d0ed12f0b
parent9b605dcdde36a2b6459fd714b26f797b10ee04ba (diff)
downloadffmpeg-7a13d99e6e350afe79b17382f7ac293bb4eef3c9.tar.gz
avformat/mov: Free encryption data on error
Fixes memleak and Coverity issue #1439587. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 3999c4b374c2f3786137bd7e820dd1555fc20d90) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavformat/mov.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9467370cce..358369b74b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6308,8 +6308,10 @@ static int mov_read_pssh(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (version > 0) {
kid_count = avio_rb32(pb);
- if (kid_count >= INT_MAX / sizeof(*key_ids))
- return AVERROR(ENOMEM);
+ if (kid_count >= INT_MAX / sizeof(*key_ids)) {
+ ret = AVERROR(ENOMEM);
+ goto finish;
+ }
for (unsigned int i = 0; i < kid_count && !pb->eof_reached; i++) {
unsigned int min_kid_count = FFMIN(FFMAX(i + 1, 1024), kid_count);