From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4CB4447CF3 for ; Wed, 14 Aug 2024 22:37:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D788668DB53; Thu, 15 Aug 2024 01:37:26 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E49868DAD7 for ; Thu, 15 Aug 2024 01:37:18 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id EEC4940002 for ; Wed, 14 Aug 2024 22:37:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1723675038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DWiaIFZFaNQgcQxRyfOauhxuX0KSpoGk58fUqa+si8k=; b=hw9ZrQZUDtACbWG0ze5Bb9VYvgXHX2Ou28tUNhdnCB4yZLmAnfbohSOOSnumqI9mugmIVW yekFQ2CJffhJsjqya/6jphl0KR5474D2s22E/qDnFLKcA0AX3tfzXeJeUY53c5hpy5el/H NSnAK6ftCcuw5h82gtfdZubB0jtLSRTyRH5SljxqgJUNpbmcLQwYPdActs+y9B+6xaPBCB LqM7zXEbKob+YCu9NUEBuQCIpzcbyFVHiMV/wPVbqFpnwakTAfOjnFzxymuqD2Hg57LR87 q5lkdyq9IUdpcFTBqhMDh4K3DShQZkfePuM4K0lL+JQBPcIeL7qYncbneM0JTw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 15 Aug 2024 00:37:04 +0200 Message-ID: <20240814223714.2436993-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240814223714.2436993-1-michael@niedermayer.cc> References: <20240814223714.2436993-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/5] avcodec/wmavoice: Do not use uninitialized pitch[0] X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Fixes: use of uninitialized value Fixes: 70850/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-4806127362048000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/wmavoice.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index 3db73773b77..39868e02b3c 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -1506,6 +1506,8 @@ static int synth_frame(AVCodecContext *ctx, GetBitContext *gb, int frame_idx, /* Parse frame type ("frame header"), see frame_descs */ int bd_idx = s->vbm_tree[get_vlc2(gb, frame_type_vlc, 6, 3)], block_nsamples; + pitch[0] = INT_MAX; + if (bd_idx < 0) { av_log(ctx, AV_LOG_ERROR, "Invalid frame type VLC code, skipping\n"); @@ -1623,6 +1625,9 @@ static int synth_frame(AVCodecContext *ctx, GetBitContext *gb, int frame_idx, double i_lsps[MAX_LSPS]; float lpcs[MAX_LSPS]; + if(frame_descs[bd_idx].fcb_type >= FCB_TYPE_AW_PULSES && pitch[0] == INT_MAX) + return AVERROR_INVALIDDATA; + for (n = 0; n < s->lsps; n++) // LSF -> LSP i_lsps[n] = cos(0.5 * (prev_lsps[n] + lsps[n])); ff_acelp_lspd2lpc(i_lsps, lpcs, s->lsps >> 1); -- 2.45.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".