summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-02-09 22:01:03 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-09 22:19:40 +0200
commitb7a305ab6bd9b450d1e01e1f27b94fe089632a26 (patch)
tree7392ea83cbb6c27a7475b8251bd6cd1ec01ba603
parent76e56f0006382189bdc0892791478f996278ac05 (diff)
downloadffmpeg-b7a305ab6bd9b450d1e01e1f27b94fe089632a26.tar.gz
avformat/mov: Corner case encryption error cleanup in mov_read_senc()
Fixes: memleak Fixes: 42341/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4566632823914496 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 8ee0e4abcb8af36cae4eb24d4d6229461c1e3333) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b266687656..67dcbd5b7a 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6049,6 +6049,8 @@ static int mov_read_senc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
}
if (pb->eof_reached) {
av_log(c->fc, AV_LOG_ERROR, "Hit EOF while reading senc\n");
+ if (ret >= 0)
+ av_encryption_info_free(encryption_index->encrypted_samples[i]);
ret = AVERROR_INVALIDDATA;
}