avformat/mov: Fix memory leak in encryption info.
authorJacob Trimble <modmaker-at-google.com@ffmpeg.org>
Thu, 19 Apr 2018 16:35:22 +0000 (09:35 -0700)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 19 Apr 2018 19:49:47 +0000 (21:49 +0200)
Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mov.c

index fc512b8..4eda48d 100644 (file)
@@ -5833,6 +5833,7 @@ static int mov_read_sample_encryption_info(MOVContext *c, AVIOContext *pb, MOVSt
 
     if (use_subsamples) {
         subsample_count = avio_rb16(pb);
+        av_free((*sample)->subsamples);
         (*sample)->subsamples = av_mallocz_array(subsample_count, sizeof(*subsamples));
         if (!(*sample)->subsamples) {
             av_encryption_info_free(*sample);