From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 68F684CE91 for ; Fri, 31 Oct 2025 23:12:45 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'YTrUhxAD+2qSDC8Lt9ULuod+mRHc+QAugM21PfqBtOI=', expected b'1X7cPThoi6bxqHcPZIxipMIVXW9XqGzJqgRyTioT6RU=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1761952280; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=YTrUhxAD+2qSDC8Lt9ULuod+mRHc+QAugM21PfqBtOI=; b=2vQ2tCBrvEmqSFDsBZXVxESOwxp6GkIDTMCXNG/Rh7dySWrw7MObpdpaiy4E/5ImDJ9tm KohGeBu6mNt4bmUFUXTpwHFTuTFm5LTqSCQf95RYRysYdEvfK63twpGUmNWsoUZF7OJ1y4T 9Zgrjb14zSVO/QBLMM2a4CTQULrCD02hNlqdFdr8q5W4J1Lrr+uQuypR9jNnlYCJn5i4sVt ztGUExxGlUSlvF5aLzj6YQxghFNb1BJrQfk/nB4iZxDgipo5ZO8yD0YKc3mV7S810nud4Jd POnSE8hl9GEMRrGAz3/kxKpKB5Y6OTh9Ryy/OdVQVgIAo6byfuPjQC1YAVug== Received: from [172.19.0.2] (unknown [172.19.0.2]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id BA77068FA3A; Sat, 1 Nov 2025 01:11:20 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1761952251; b=slbGo1n5daMZovVbKUObM7HPGg24XHu9wvtwyvjrdLoGBuxbz9TMsTHp3eSECngL/QruL LJrzhtIkzTZwzarFExlP1wAtOmidx0v35RJHp7uy7EOS4SWWD5jBFqsgBeOIENE8dBT319c s5e18+S65Zf/9YwK1Fyr6o7rwFISnfPsrL+R/FUxrqds2j4z447qMZWVvxqNkFJR6dogJh5 3EjnZbVrXB4u4bC8FN7QtlvIIqEiN589tMVMlkmnTkXzYu7DnKd37KlPLTud1ytmg0x/bsf 2n/gm1WWVBbeskkuHy8mE/vgpCOMk7LFUOmbKwb1guIpDs2VbmMjJGNmCbxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1761952251; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=Rpz6TIzhOSHpqMA+yINHUHDnlNHUt0njplvxGMDOuFs=; b=RlRMhu+ulG4ApFZony3hNYMk49XAErd2gk0bFbvHUMdxh9QVsmS/ZC5Az2/E41durnO7v JDaBsF181RjEzlhNejKm/c8OC3GQB1vTvjTKcEIJ2zL6RvVom4pt6J+u4R6rkUPGeuxxNLF jkMWzq3fLLHC/w8sRLtA+qjlXHfLm3idb6XzRywB4XeDzqYOjWS5+0DQKHjTV2ognKkntgr kEKE3Y14qKU7DYa08ajn4LKsYmpfuboFf94xsKdWoNXlZkK3hQ9dUSTdRZETQP2ksx0+P3n jpGFMc3FGKntRWmKJmei0vtgklU+RByqny8i0QELzCNrz9+7NR1CqCb+MOjw== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1761952239; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=1X7cPThoi6bxqHcPZIxipMIVXW9XqGzJqgRyTioT6RU=; b=gE9Mw5h9v6zpw8hZellW8mXAdEwoeqewS9reGYZf0dM9fx461dnKtVWEr+epNs6tudaHj j0/W0H1gajSkI/SH6rZoxmR1CwKyqQ2Vgvlqi0pTahQyAgi2o1zHKVmco/re1AxysfVOHR9 uIgvcaGRFNZ5zrRInONuJqvkUZV/+paUhJ+j9SzH1cy7PWoeJGLUZTSb7lVR5QrAhn20NKc yyShqQsb1GjXSYzBM9Zlt4SzIASIxwziQn8r1rlXLFttqw5albR7QU1PZ+pS2EJ+3rZWXMH U7O8mr44Rov189JlrdVlIIpPySnpPNgGkQ/4IINx3zISmyGkxZaDfk4gUgGg== Received: from 02c22a36bd31 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 7940968F99C for ; Sat, 1 Nov 2025 01:10:39 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Fri, 31 Oct 2025 23:10:38 -0000 Message-ID: <176195223996.25.677655688238677464@2cb04c0e5124> Message-ID-Hash: EY2O2V4HSHXNXMQH3M2WPBLX34LYK5GC X-Message-ID-Hash: EY2O2V4HSHXNXMQH3M2WPBLX34LYK5GC X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] avcodec/mediacodecdec_common: Check that the input to mediacodec_wrap_sw_audio_buffer() contains channel * sample_size (PR #20810) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: michaelni via ffmpeg-devel Cc: michaelni Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20810 opened by michaelni URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20810 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20810.patch Fixes: out of array access no testcase Found-by: Joshua Rogers with ZeroPath Signed-off-by: Michael Niedermayer >>From ac541f9e21806a4a0a0db1815582da7dfb944625 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 31 Oct 2025 23:31:40 +0100 Subject: [PATCH] avcodec/mediacodecdec_common: Check that the input to mediacodec_wrap_sw_audio_buffer() contains channel * sample_size Fixes: out of array access no testcase Found-by: Joshua Rogers with ZeroPath Signed-off-by: Michael Niedermayer --- libavcodec/mediacodecdec_common.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c index ae336ab835..9b91c8edf5 100644 --- a/libavcodec/mediacodecdec_common.c +++ b/libavcodec/mediacodecdec_common.c @@ -385,6 +385,12 @@ static int mediacodec_wrap_sw_audio_buffer(AVCodecContext *avctx, goto done; } + if (info->size % (sample_size * avctx->ch_layout.nb_channels)) { + av_log(avctx, AV_LOG_ERROR, "input is not a multiple of channels * sample_size\n"); + ret = AVERROR(EINVAL); + goto done; + } + frame->format = avctx->sample_fmt; frame->sample_rate = avctx->sample_rate; frame->nb_samples = info->size / (sample_size * avctx->ch_layout.nb_channels); -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org