1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

speexdec: fix framesize for ultra-wideband

This matches how the libspeex decoder is calculating frame size (except in clamp form).

Fixes #11495

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Tristan Matthews
2025-03-13 14:54:48 -04:00
committed by James Almer
parent 64087171f6
commit c14b837ded

View File

@ -1426,7 +1426,7 @@ static int parse_speex_extradata(AVCodecContext *avctx,
if (s->frame_size < NB_FRAME_SIZE << (s->mode > 1) ||
s->frame_size > INT32_MAX >> (s->mode > 1))
return AVERROR_INVALIDDATA;
s->frame_size <<= (s->mode > 1);
s->frame_size = FFMIN(s->frame_size << (s->mode > 1), NB_FRAME_SIZE << s->mode);
s->vbr = bytestream_get_le32(&buf);
s->frames_per_packet = bytestream_get_le32(&buf);
if (s->frames_per_packet <= 0 ||