mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-13 17:07:21 +00:00
avcodec/nellymoserdec: Check block count to avoid integer overflow
Fixes: out of array access Fixes: nelly.avi / gen_nelly_overflow.py Fixes: pgc86PfE7ZpA Fixes:0eea212943(Add avcodec_decode_audio4().) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commitf9482e1d01) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
3abec89a45
commit
2864ce5e28
@@ -156,8 +156,8 @@ static int decode_tag(AVCodecContext *avctx, AVFrame *frame,
|
||||
|
||||
blocks = buf_size / NELLY_BLOCK_LEN;
|
||||
|
||||
if (blocks <= 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
|
||||
if (blocks <= 0 || blocks > INT_MAX / NELLY_SAMPLES) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Packet is too small or too large\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user