You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/speexdec: Avoid violating the vector_fmul_scalar() API
Fixes: out of array access Fixes: 40054/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-6713285764841472 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -1545,7 +1545,7 @@ static int speex_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
if ((ret = init_get_bits8(&s->gb, avpkt->data, buf_size)) < 0)
|
if ((ret = init_get_bits8(&s->gb, avpkt->data, buf_size)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
frame->nb_samples = s->frame_size * s->frames_per_packet;
|
frame->nb_samples = FFALIGN(s->frame_size * s->frames_per_packet, 4);
|
||||||
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -1560,6 +1560,7 @@ static int speex_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
|
|
||||||
dst = (float *)frame->extended_data[0];
|
dst = (float *)frame->extended_data[0];
|
||||||
s->fdsp->vector_fmul_scalar(dst, dst, scale, frame->nb_samples * frame->channels);
|
s->fdsp->vector_fmul_scalar(dst, dst, scale, frame->nb_samples * frame->channels);
|
||||||
|
frame->nb_samples = s->frame_size * s->frames_per_packet;
|
||||||
|
|
||||||
*got_frame_ptr = 1;
|
*got_frame_ptr = 1;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user