[FFmpeg-cvslog] speexdec: fix framesize for ultra-wideband

Tristan Matthews git at videolan.org
Sun Mar 30 18:20:39 EEST 2025


ffmpeg | branch: master | Tristan Matthews <tmatth at videolan.org> | Thu Mar 13 14:54:48 2025 -0400| [c14b837dedade432a5f95981c3b1677099015376] | committer: James Almer

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 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c14b837dedade432a5f95981c3b1677099015376
---

 libavcodec/speexdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
index 90a1b50bd6..60daab3b01 100644
--- a/libavcodec/speexdec.c
+++ b/libavcodec/speexdec.c
@@ -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 ||



More information about the ffmpeg-cvslog mailing list