mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-09 09:32:43 +00:00
avcodec/libcodec2: reject packet sample counts that overflow int
Fixes: out of array access
Fixes: 2jy_poc_codec2.zip / poc_codec2.raw
Fixes: jOQASNnOm6O7
Found-by: Jiale Yao <yaojiale02@163.com>
(cherry picked from commit 705ff11c2b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
789d7b1b1d
commit
bd2541b8da
@@ -132,6 +132,8 @@ static int libcodec2_decode(AVCodecContext *avctx, AVFrame *frame,
|
||||
int16_t *output;
|
||||
|
||||
nframes = pkt->size / avctx->block_align;
|
||||
if (nframes > INT_MAX / avctx->frame_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame->nb_samples = avctx->frame_size * nframes;
|
||||
|
||||
ret = ff_get_buffer(avctx, frame, 0);
|
||||
|
||||
Reference in New Issue
Block a user