@@ -6041,6 +6041,11 @@ static int mov_read_saiz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (ret != 1)
return ret;
+ if (!sc->cenc.default_encrypted_sample) {
+ // Didn't see a 'schm' or 'tenc' atom, so it isn't encrypted.
+ return 0;
+ }
+
if (encryption_index->nb_encrypted_samples) {
// This can happen if we have both saio/saiz and senc atoms.
av_log(c->fc, AV_LOG_DEBUG, "Ignoring duplicate encryption info in saiz\n");
@@ -6095,6 +6100,11 @@ static int mov_read_saio(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (ret != 1)
return ret;
+ if (!sc->cenc.default_encrypted_sample) {
+ // Didn't see a 'schm' or 'tenc' atom, so it isn't encrypted.
+ return 0;
+ }
+
if (encryption_index->nb_encrypted_samples) {
// This can happen if we have both saio/saiz and senc atoms.
av_log(c->fc, AV_LOG_DEBUG, "Ignoring duplicate encryption info in saio\n");
Found by Chrome's ClusterFuzz: http://crbug.com/850389 Signed-off-by: Jacob Trimble <modmaker@google.com> --- libavformat/mov.c | 10 ++++++++++ 1 file changed, 10 insertions(+)