From 7f5db34f3b02ea5c1a951e65f04e313841ee888e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sat, 26 Jul 2025 04:59:44 +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/g722dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/g722dec.c b/libavcodec/g722dec.c index 231f1d32eb..cc89737b31 100644 --- a/libavcodec/g722dec.c +++ b/libavcodec/g722dec.c @@ -63,6 +63,8 @@ static av_cold int g722_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_S16; + if (!avctx->sample_rate) + avctx->sample_rate = 16000; c->band[0].scale_factor = 8; c->band[1].scale_factor = 2;