[FFmpeg-devel] [PATCH] avformat/mov: Fix reading saio/saiz for clear content.

Jacob Trimble modmaker at google.com
Thu Jun 7 20:36:33 EEST 2018


Found by Chrome's ClusterFuzz: http://crbug.com/850389

Signed-off-by: Jacob Trimble <modmaker at google.com>
---
 libavformat/mov.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4ad19122b3..d07171b3f4 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -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");
-- 
2.17.1.1185.g55be947832-goog



More information about the ffmpeg-devel mailing list