[FFmpeg-cvslog] avformat/mov: Corner case encryption error cleanup in mov_read_senc()

Michael Niedermayer git at videolan.org
Fri Apr 8 01:31:48 EEST 2022


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Wed Feb  9 22:01:03 2022 +0100| [bc56a270949c1ce214c4fe1126b1ef85f0e42b29] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit 8ee0e4abcb8af36cae4eb24d4d6229461c1e3333)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bc56a270949c1ce214c4fe1126b1ef85f0e42b29
---

 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index f7951f3f7d..93263c2d9e 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6043,6 +6043,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;
         }
 



More information about the ffmpeg-cvslog mailing list