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 C3BBA4E033 for ; Fri, 7 Mar 2025 00:36:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7BFE068F4F9; Fri, 7 Mar 2025 02:36:09 +0200 (EET) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 961C868DF4D for ; Fri, 7 Mar 2025 02:36:05 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 065C244388 for ; Fri, 7 Mar 2025 00:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1741307765; 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: in-reply-to:in-reply-to:references:references; bh=fU9kklTz3zvJwWajeNh6G+FO2jkliXszTZ9SpNB5IE4=; b=lr54VmDA52BozgUKNKn+l8j04oXu9VXxHRnTXwJuovBg703Hn15HGqQwMIbzxpW92VVF1G 1CuhDUhOSIdzui/hPGO4bhqt6oMfSHLKmLDZvvLdT96s4wtZiXwB0lhIZg8XEFz2DpSZJj HjMmchmdO9hPAUFOxwCYjeStOmDzBc/WxiLL3AfNIKWQgLRYU6Oz0U15ibTAqZg+md1xlZ LTjWt7pGtxulHjmQN5Uff+PiIFoI+zEMqSCszrJ2dNQcGiUc1IVdvfIRZp4MUpNzhQvW8Z y1y8y3FrJv3CSo13jyZ489g3uuYb+ObB9Y3xMnpBmpMG4+hBxueixne3CGYfdw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 7 Mar 2025 01:36:03 +0100 Message-ID: <20250307003603.962753-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250307003603.962753-1-michael@niedermayer.cc> References: <20250307003603.962753-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddutdelvddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdeftddmnecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpedvgfefudeijeetieejkefgfffhtdeludeuffdvfeelieevjeetvedufeetfeejfeenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/ffv1dec_template: wrap around in fltmap table 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: Avoids out of array access Another solution may be choosen later if something else turns out to fit naturally into the decoder. But for now dont crash Signed-off-by: Michael Niedermayer --- libavcodec/ffv1dec_template.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/ffv1dec_template.c b/libavcodec/ffv1dec_template.c index 37caacb758d..818f12f865d 100644 --- a/libavcodec/ffv1dec_template.c +++ b/libavcodec/ffv1dec_template.c @@ -225,11 +225,11 @@ static int RENAME(decode_rgb_frame)(FFV1Context *f, FFV1SliceContext *sc, r += g; } if (sc->remap) { - r = sc->fltmap[0][r]; - g = sc->fltmap[1][g]; - b = sc->fltmap[2][b]; + r = sc->fltmap[0][r & 0xFFFF]; + g = sc->fltmap[1][g & 0xFFFF]; + b = sc->fltmap[2][b & 0xFFFF]; if (transparency) - a = sc->fltmap[3][a]; + a = sc->fltmap[3][a & 0xFFFF]; } if (lbd) -- 2.48.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".