summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorJacob Trimble <modmaker@google.com>2018-08-14 10:18:55 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2018-08-22 18:54:23 +0200
commiteb350ab738e7e2590b26d97c465da1138fe54598 (patch)
treec5c6042b85ed9c115a1b9d77596c110af424ee14 /libavformat/mov.c
parent130de9142edd8f0ab2001fbedb839649fed0b9b6 (diff)
avformat/mov: Allow saio/saiz in clear content.
If there is a saio/saiz in clear content, we shouldn't create the encryption index if we don't already have one. Otherwise it will confuse the cenc_filter. The changed method is also used for senc atoms, but they should not appear in clear content. Found by Chromium's ClusterFuzz: https://crbug.com/873432 Signed-off-by: Jacob Trimble <modmaker@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1bd7d7e483..f36820995d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5845,6 +5845,9 @@ static int get_current_encryption_info(MOVContext *c, MOVEncryptionIndex **encry
*sc = st->priv_data;
if (!frag_stream_info->encryption_index) {
+ // If this stream isn't encrypted, don't create the index.
+ if (!(*sc)->cenc.default_encrypted_sample)
+ return 0;
frag_stream_info->encryption_index = av_mallocz(sizeof(*frag_stream_info->encryption_index));
if (!frag_stream_info->encryption_index)
return AVERROR(ENOMEM);
@@ -5860,6 +5863,9 @@ static int get_current_encryption_info(MOVContext *c, MOVEncryptionIndex **encry
*sc = st->priv_data;
if (!(*sc)->cenc.encryption_index) {
+ // If this stream isn't encrypted, don't create the index.
+ if (!(*sc)->cenc.default_encrypted_sample)
+ return 0;
(*sc)->cenc.encryption_index = av_mallocz(sizeof(*frag_stream_info->encryption_index));
if (!(*sc)->cenc.encryption_index)
return AVERROR(ENOMEM);