mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-12-13 14:17:59 +00:00
smacker: Check that the data size is a multiple of a sample vector
Fixes out of array access
Fixes: ce19e41f0ef1e52a23edc488faecdb58/asan_heap-oob_2504e97_4202_ffa0df1baed14022b9bfd4f8ac23d0cb.smk
Bug-Id: CVE-2015-8365
CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4a9af07a49
)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
This commit is contained in:
parent
2ca759657b
commit
b98f082d8d
@ -636,6 +636,11 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
|
||||
av_log(avctx, AV_LOG_ERROR, "sample format mismatch\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (unp_size % (avctx->channels * (bits + 1))) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"The buffer does not contain an integer number of samples\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = unp_size / (avctx->channels * (bits + 1));
|
||||
|
Loading…
Reference in New Issue
Block a user