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 6D9674755B for ; Sat, 11 May 2024 01:23:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A0F5268D58D; Sat, 11 May 2024 04:23:03 +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 A186968D38C for ; Sat, 11 May 2024 04:22:56 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4D1A240002 for ; Sat, 11 May 2024 01:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1715390575; 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; bh=R6s7OmbjklWDSwiBgXr+chaztnQgqMZ4YsdyE06K3eM=; b=F4yxfK7GlXTLi5bl2hd5zvrIaED//Jjx8n4i5rmHaZOQOQt87zVjycLA/Hf5/nL5iBv0CZ jNZiAXyqspnwW2MSPkqd++FCuNBoLGZCnmjyF98JHir3HKsAL9oMYF5Q4LI10Bj/yNYPwp XSF+VfDMOo77PpdbMG0fo7PPTi429Yz1f9mz/EW9/i8qlRwtUirQ6x1fKUHiJkSdtcB3Ue pI30YXbuo35FtUFngfaGTI4q6LUz3/FVEPOYznZWkz7LaZt9KT5Db+gpB6XChKxV1t7tbk LvN8x2dlYN/oi7IUzpocRQ6W9Bw5y9GS/4vAanS0iQbPA1BJ1LKskhaqJzhC3g== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 11 May 2024 03:22:53 +0200 Message-ID: <20240511012254.1612731-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/2] libavutil/base64: Try not to write over the array end 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: Signed-off-by: Michael Niedermayer --- libavutil/base64.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavutil/base64.c b/libavutil/base64.c index 3e66f4fcbe5..69e11e6f5e1 100644 --- a/libavutil/base64.c +++ b/libavutil/base64.c @@ -127,10 +127,12 @@ validity_check: } out3: - *dst++ = v >> 10; + if (end - dst) + *dst++ = v >> 10; v <<= 2; out2: - *dst++ = v >> 4; + if (end - dst) + *dst++ = v >> 4; out1: out0: return bits & 1 ? AVERROR_INVALIDDATA : out ? dst - out : 0; -- 2.43.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".