diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2025-07-26 05:00:11 +0200 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2025-08-05 03:27:54 +0200 |
commit | 8b5db38dc6d0bec05ce7e4c1451986055032ed9c (patch) | |
tree | e322fec2cf758a1596a14fd163f7b943026d03f1 | |
parent | 7f5db34f3b02ea5c1a951e65f04e313841ee888e (diff) | |
download | ffmpeg-8b5db38dc6d0bec05ce7e4c1451986055032ed9c.tar.gz |
avcodec/qcelpdec: set missing sample rate
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 <kasper93@gmail.com>
-rw-r--r-- | libavcodec/qcelpdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |