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 358BF401D2 for ; Sat, 30 Dec 2023 02:49:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C110568CBF5; Sat, 30 Dec 2023 04:49:15 +0200 (EET) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D354E68CAAA for ; Sat, 30 Dec 2023 04:49:08 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id E35F81C0002 for ; Sat, 30 Dec 2023 02:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1703904548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc; bh=eqIwoPHPbQW8nUnp2uW/7IcrsI6pp3lcecfttQdr/eI=; b=j4XsTH/Es7BZsi77C69kG1vNMne2abGVXobfh0z9dHMdGVaK0SNzoLsCHI3kv9h7w9+Uvp 60zUgOQpCt+bwIY/LDxAQUOv9asnRAwzgp81bxvptFRcXTDgvIS0ADPDa+bvZOzM0uUQ66 xtn9NSKBNXTUVv+qwl8npWjkMRimTBtvKnI/5rBV6sKWFNkMPxqAYiA41udAfFoI7DD4uY e2+6QRXkVkn1mrSQNuOUYqXIdR6X0ghSgWAPuLx7TXeql+maXNXAXTJv9SkyKrRsxf28Ya te8c+nuZewIXOzbxG1uNBWnC65ncTUFgtQ/IZBopNFn3hXoc7ipv1HXK9U9YlQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 30 Dec 2023 03:49:02 +0100 Message-Id: <20231230024905.17121-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/4] avfilter/avf_showwaves: Check history_nb_samples 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 MIME-Version: 1.0 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: out of array access Fixes: tickets/10756/poc18ffmpeg Discovered by Zeng Yunxiang Signed-off-by: Michael Niedermayer --- libavfilter/avf_showwaves.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c index 329753c8c86..e19b93a2077 100644 --- a/libavfilter/avf_showwaves.c +++ b/libavfilter/avf_showwaves.c @@ -440,6 +440,8 @@ static int config_output(AVFilterLink *outlink) showwaves->history_nb_samples = av_rescale(showwaves->w * nb_channels * 2, showwaves->n.num, showwaves->n.den); + if (showwaves->history_nb_samples <= 0) + return AVERROR(EINVAL); showwaves->history = av_calloc(showwaves->history_nb_samples, sizeof(*showwaves->history)); if (!showwaves->history) -- 2.17.1 _______________________________________________ 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".