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 E7F984C8B6 for ; Wed, 6 Aug 2025 10:14:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 3EACB68C6C8; Wed, 6 Aug 2025 13:14:47 +0300 (EEST) Received: from 264e01bdf0e5 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 012DB68C25D for ; Wed, 6 Aug 2025 13:14:45 +0300 (EEST) MIME-Version: 1.0 From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] =?utf-8?q?=5BPATCH=5D_avfilter/vf=5Fthumbnail=3A_?= =?utf-8?q?fix_buffer_overflow_for_odd_sized_HBD_inputs_=28PR_=2320132=29?= 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" Message-Id: <20250806101447.3EACB68C6C8@ffbox0-bg.ffmpeg.org> Date: Wed, 6 Aug 2025 13:14:47 +0300 (EEST) Archived-At: List-Archive: List-Post: PR #20132 opened by Niklas Haas (haasn) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20132 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20132.patch This histogram index was not correctly downshifted to 8-bit. >From 651ce7dbc9cb88ab01002867ddb5b44a6f17a647 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 6 Aug 2025 12:11:59 +0200 Subject: [PATCH] avfilter/vf_thumbnail: fix buffer overflow for odd sized HBD inputs This histogram index was not correctly downshifted to 8-bit. --- libavfilter/vf_thumbnail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_thumbnail.c b/libavfilter/vf_thumbnail.c index 8cda7b45f1..728880e100 100644 --- a/libavfilter/vf_thumbnail.c +++ b/libavfilter/vf_thumbnail.c @@ -189,7 +189,7 @@ static void get_hist16(int *hist, const uint8_t *p, ptrdiff_t stride, } /* handle tail */ for (int x = width4; x < width; x++) - hist[p16[x]]++; + hist[(uint8_t) (p16[x] >> shift)]++; p += stride; } -- 2.49.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".