From patchwork Fri Jan 13 00:01:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 39993 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bb05:b0:b6:a58c:cef with SMTP id fc5csp62860pzb; Thu, 12 Jan 2023 16:02:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXvfrC+M+XEiulJAUv6fckk9CvmxMvzFJEBO7RYFnboCER4A/tOlyfXE6N431x/jQiO0mFfm X-Received: by 2002:a05:6402:610:b0:499:bffb:7e58 with SMTP id n16-20020a056402061000b00499bffb7e58mr13190079edv.20.1673568151874; Thu, 12 Jan 2023 16:02:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673568151; cv=none; d=google.com; s=arc-20160816; b=BlEhr4gkDpCXaQ4tJbqNeMOqa9wCSThpbQUiLaE4uMT7fTw42Qy+hNchHvMGlQ9LiF fo0o/DYi0KFAjCvGD+fycXrDCdR02ZVmCiZaWIrpSQLpOfnLbMKueKZQWoSxweU9Esfq Jauo5ds7Uh3cWG9jc5+hmPdHzlsMTcYSklzIibC24aDPS0c5miagpsZ8t2tw5e5DbbS0 HuFbGvMXxscb6nHQK5LhErYtG7NVrCK9dvMlsC0y8v6G5OPgQN6/js8FeoHP7b4XQm2J mhYh0AB/xUSzW1bQPcIHw9Zps9mQbnZQmjaU4dmZ/zZj9XB4zzpziYfuapMPfn5UP1Fg iJUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=eRmXjt9df+aqhfcZmJeYDnUo5S8ievUAW4BdlexeMzE=; b=WnlACNgFVFNLS5OaGAat4pEOtvYZoITjQ/o0bLkXALaLAP+5k7wMg9rbFR5+KCZVap tfT0FGx4D/A2dvLV2jUnyXvXOVUp55v2KrsrXqFu/EVY1mrDLnEZLjz3p2vMcf5vsB1y YAo1sumNbDafkYOONY+ZOaOwvre/QDIOKTpzGsP2yp1Lee0dbf8nTLZxNSSFc/asa+3q IGb1kZ5PSwt8LjJ4mXUx6ozW5VMvdX6D7SyIG8aLTPPlQGi8WJtUJUuvNkwqy/YAodTr W/ZRG2vWnXslmo5nKs7sabLy7JR7d4Nn5cRce0nuXCZY2+AALBcuUUhNGhkxpCL5HYSa dB7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l21-20020a056402345500b00499c02e381esi9234032edc.157.2023.01.12.16.02.26; Thu, 12 Jan 2023 16:02:31 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 96A5468B6F0; Fri, 13 Jan 2023 02:01:50 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6406D68BC82 for ; Fri, 13 Jan 2023 02:01:43 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 597D9240003 for ; Fri, 13 Jan 2023 00:01:41 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 13 Jan 2023 01:01:37 +0100 Message-Id: <20230113000138.9994-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230113000138.9994-1-michael@niedermayer.cc> References: <20230113000138.9994-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 4/5] avcodec/motionpixels: Mask pixels to valid values 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: v0m0ypKGQhzU Fixes: out of array access Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOTIONPIXELS_fuzzer-6724203352555520 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/motionpixels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index 4141c5a495..a947ca05de 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -185,7 +185,7 @@ static YuvPixel mp_get_yuv_from_rgb(MotionPixelsContext *mp, int x, int y) int color; color = *(uint16_t *)&mp->frame->data[0][y * mp->frame->linesize[0] + x * 2]; - return mp_rgb_yuv_table[color]; + return mp_rgb_yuv_table[color & 0x7FFF]; } static void mp_set_rgb_from_yuv(MotionPixelsContext *mp, int x, int y, const YuvPixel *p)