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>2020-01-27 11:28:18 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-20 11:51:29 +0300
commit09d2b9b7bedb1e95a5aa365794c02fb5dd183025 (patch)
treec3ddc4f158411ce2fcab39710525ea891c66b446 /libavformat/mov.c
parentf23478aba26c52b057e3a09d5bc0907ddf72c136 (diff)
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)
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 2e726d3e90..0a9abaa795 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6310,8 +6310,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);