mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
pcmdec: check codec_id
Fixes out of array accesses Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
b90e795f73
commit
f0695b09dd
@ -338,6 +338,11 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (avctx->codec_id != avctx->codec->id) {
|
||||
av_log(avctx, AV_LOG_ERROR, "codec ids mismatch\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
n = avctx->channels * sample_size;
|
||||
|
||||
if (n && buf_size % n) {
|
||||
|
Loading…
Reference in New Issue
Block a user