From 8b5db38dc6d0bec05ce7e4c1451986055032ed9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sat, 26 Jul 2025 05:00:11 +0200 Subject: [PATCH] avcodec/qcelpdec: set missing sample rate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit f566032bfda2fee4fb6388d5906d1957a1ed868a added frame validation. Since then this decoder has been failing validation of sample rate value. Found by OSS-Fuzz. Signed-off-by: Kacper Michajłow --- libavcodec/qcelpdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c index 7d23a11102..4ec25a8f0f 100644 --- a/libavcodec/qcelpdec.c +++ b/libavcodec/qcelpdec.c @@ -89,6 +89,8 @@ static av_cold int qcelp_decode_init(AVCodecContext *avctx) av_channel_layout_uninit(&avctx->ch_layout); avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; avctx->sample_fmt = AV_SAMPLE_FMT_FLT; + if (!avctx->sample_rate) + avctx->sample_rate = 8000; for (i = 0; i < 10; i++) q->prev_lspf[i] = (i + 1) / 11.0;