forked from FFmpeg/FFmpeg
avformat/mov: Fix nullptr dereference with invalid encryption metadata.
Found by fuzzer. Bug: https://crbug.com/356720789 Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
181cd260db
commit
4230379835
1 changed files with 6 additions and 2 deletions
|
@ -8143,15 +8143,19 @@ static int cenc_filter(MOVContext *mov, AVStream* st, MOVStreamContext *sc, AVPa
|
|||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
encrypted_sample = NULL;
|
||||
if (!encryption_index->nb_encrypted_samples) {
|
||||
// Full-sample encryption with default settings.
|
||||
encrypted_sample = sc->cenc.default_encrypted_sample;
|
||||
} else if (encrypted_index >= 0 && encrypted_index < encryption_index->nb_encrypted_samples) {
|
||||
// Per-sample setting override.
|
||||
encrypted_sample = encryption_index->encrypted_samples[encrypted_index];
|
||||
if (!encrypted_sample)
|
||||
if (!encrypted_sample) {
|
||||
encrypted_sample = sc->cenc.default_encrypted_sample;
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
if (!encrypted_sample) {
|
||||
av_log(mov->fc, AV_LOG_ERROR, "Incorrect number of samples in encryption info\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue