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 ESMTPS id 38DB94BD86 for ; Mon, 3 Feb 2025 08:05:34 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4834568BFFD; Mon, 3 Feb 2025 10:05:31 +0200 (EET) Received: from sender2-op-o18.zoho.eu (sender2-op-o18.zoho.eu [136.143.171.18]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C73A668BB22 for ; Mon, 3 Feb 2025 10:05:24 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; t=1738569922; cv=none; d=zohomail.eu; s=zohoarc; b=cDXql0TDCivCWON5UF8XONia0JlStvgnz7t7fkhJUYAU2zyVCYlQVmIArIopQj9nZqsIQyL0OwtUz5CenlFEpwwe/gA7rYaGp1w6fohkw2pHJ4wlMMrshax9dyd1YnOCL9zZ9bgvZ3VdTamPa1024+GaqOFkSFP3rUlV4GO2Hq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1738569922; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=14QMX9b/ikgvtJvi0gCqospHvHNF9dtclzM2/SceO8U=; b=LrpSRo1qFHA/1NS0+yjHmcqXmswGhKb3PLGm4l/SuA9+yX6c6y3t31WWK2AkIM5lo21zfs6POE/E5OLazPj743RrMyReXyGnJbxPagQB0q89rcVXntMy+ZZee1aboZ1iu+RVhaTH1W75ij/nE+4YmDVI9r6rtMp6STrLEIqisYQ= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=frankplowman.com; spf=pass smtp.mailfrom=post@frankplowman.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1738569921; s=zmail; d=frankplowman.com; i=post@frankplowman.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=14QMX9b/ikgvtJvi0gCqospHvHNF9dtclzM2/SceO8U=; b=WV1Rr83y+ZlVvtkfM+LHpFwmXeut20jynQVAX0Fp1J0OywBjXFxYBLidu8qyZ9j5 fsTmmot0vVPbGihdG3+cdis0uFwurcMu/X/3f2hV7OT+SVnvOUjFtJ1V5nu7lX0Votv zqsgymR3XJ+Z8bF+dFMdFIF3ccF7WFky3CzAGhns= Received: by mx.zoho.eu with SMTPS id 1738569919607298.97758051519054; Mon, 3 Feb 2025 09:05:19 +0100 (CET) Message-ID: Date: Mon, 3 Feb 2025 08:05:19 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-GB To: ffmpeg-devel@ffmpeg.org References: <20250202211721.1469377-1-michael@niedermayer.cc> From: Frank Plowman In-Reply-To: <20250202211721.1469377-1-michael@niedermayer.cc> X-ZohoMailClient: External Subject: Re: [FFmpeg-devel] [PATCH 1/2] avcodec/vvc/refs: fix negative pps_scaling_win offsets 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: On 02/02/2025 21:17, Michael Niedermayer wrote: > The spec seems to allow these to be negative > > Fixes: left shift of negative value -15 > Fixes: 392687035/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-6559804532785152 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/vvc/refs.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/libavcodec/vvc/refs.c b/libavcodec/vvc/refs.c > index 8d4b7bb35b2..486515d06db 100644 > --- a/libavcodec/vvc/refs.c > +++ b/libavcodec/vvc/refs.c > @@ -147,10 +147,10 @@ static VVCFrame *alloc_frame(VVCContext *s, VVCFrameContext *fc) > for (int j = 0; j < frame->ctb_count; j++) > frame->rpl_tab[j] = frame->rpl; > > - win->left_offset = pps->r->pps_scaling_win_left_offset << sps->hshift[CHROMA]; > - win->right_offset = pps->r->pps_scaling_win_right_offset << sps->hshift[CHROMA]; > - win->top_offset = pps->r->pps_scaling_win_top_offset << sps->vshift[CHROMA]; > - win->bottom_offset = pps->r->pps_scaling_win_bottom_offset << sps->vshift[CHROMA]; > + win->left_offset = pps->r->pps_scaling_win_left_offset * (1 << sps->hshift[CHROMA]); > + win->right_offset = pps->r->pps_scaling_win_right_offset * (1 << sps->hshift[CHROMA]); > + win->top_offset = pps->r->pps_scaling_win_top_offset * (1 << sps->vshift[CHROMA]); > + win->bottom_offset = pps->r->pps_scaling_win_bottom_offset * (1 << sps->vshift[CHROMA]); > frame->ref_width = pps->r->pps_pic_width_in_luma_samples - win->left_offset - win->right_offset; > frame->ref_height = pps->r->pps_pic_height_in_luma_samples - win->bottom_offset - win->top_offset; > This patch LGTM. -- Frank _______________________________________________ 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".