diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-07-21 17:20:44 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-07-26 02:42:42 +0200 |
commit | a37c62026991853a17ce9e19ff0cf39b2a2b1974 (patch) | |
tree | b32541ff93b17bef0ecc57b7d2f34fa89a54dd92 /libavformat | |
parent | 8b710ea5e7b8a3c3f60fb867bb104b0ec9ea4e83 (diff) | |
download | ffmpeg-a37c62026991853a17ce9e19ff0cf39b2a2b1974.tar.gz |
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')
-rw-r--r-- | libavformat/mov.c | 5 |
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); |