summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-07-21 17:20:44 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-26 02:42:42 +0200
commita37c62026991853a17ce9e19ff0cf39b2a2b1974 (patch)
treeb32541ff93b17bef0ecc57b7d2f34fa89a54dd92 /libavformat/mov.c
parent8b710ea5e7b8a3c3f60fb867bb104b0ec9ea4e83 (diff)
avformat/mov: Check default_encrypted_sample before use in mov_read_sample_encryption_info()
Fixes: 2018-0721-sample Fixes: null pointer dereference Found-by: Nikita Knyzhov (knnikita@yandex.ru) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 870c603f0b..82cd410a72 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5876,6 +5876,11 @@ static int mov_read_sample_encryption_info(MOVContext *c, AVIOContext *pb, MOVSt
unsigned int subsample_count;
AVSubsampleEncryptionInfo *subsamples;
+ if (!sc->cenc.default_encrypted_sample) {
+ av_log(c->fc, AV_LOG_ERROR, "Missing schm or tenc\n");
+ return AVERROR_INVALIDDATA;
+ }
+
*sample = av_encryption_info_clone(sc->cenc.default_encrypted_sample);
if (!*sample)
return AVERROR(ENOMEM);