From patchwork Mon Oct 30 22:21:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 5768 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp3209048jah; Mon, 30 Oct 2017 15:21:52 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TXy6jmX0jT0h6TjLDp/a95DOZbIVHnEr/A6fpy3u/cvV1gr0iDznJ961AOedoAOyYijjP1 X-Received: by 10.223.156.193 with SMTP id h1mr7559279wre.174.1509402112813; Mon, 30 Oct 2017 15:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509402112; cv=none; d=google.com; s=arc-20160816; b=NVTiI1GxzZlpgrxCWLLCPhHl63IHOCfp3PypkvRxRcvPcHgsYF03oB+U8AtWr6I684 /g6wIZyq7rtmNXUTra2ILEtBAS7RfvI7h3+HNZNQTgZO32Vu2rmWxG4CcsaL1+mcw31f QITdGC/ujs6VIZSAqb0kWyklacxpXCCkU8RtK8bNIpBaQ5k1q3OLngsdXnyFfSPSi/Zh FwAzoL58Bb8a5lqBR6liYsJqj1ceaC1Mh8f2sdP49WuDX8urzhII5Yd2sakohVfNRavu hKJQVghVqljAEdiuI5QKRdip/NHcg08PxAbM6P1RunQFzgqfbfQqfat2IMQO7ibUA0eI BLpg== 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:message-id:date:to:from:delivered-to :arc-authentication-results; bh=zNQyByW8sQBjvNjaZU8d+kbnhfRTaijugCPHARcKMWg=; b=huvz/DmheWgzbgmsaPG/O1UAVQQW1zbh/PvQ2zmsVzZuzQE0aOdnZEUQYiymWJi+p9 3biupeYWWtq9mmYyCQxXkA0OAoCDo7/C5pgBpb6s2UADpfRqXhs591StMUYgAcVMOqXO MLATJ/A7BPyJZ+lrfdYJuavtoSk0aEVKUwou7rNR7Ugy/0XqasvfckaUhgiRAPvWVY8T lIZuFbEXQUMxBL8assbdhy4ANKa2Ebgdi1cotM/+gWmnL0gAJDYGNlPvvsHnJIt3wEP5 nArq2wd1X9gQHO7IUOqrlkk+pDDi11ZysUOB7c0LlKvyalNosKiMkuoKXGKdEPJUBgap 4wzg== 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 60si878546wrp.239.2017.10.30.15.21.52; Mon, 30 Oct 2017 15:21:52 -0700 (PDT) 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 D3A0F689D33; Tue, 31 Oct 2017 00:21:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe07-3.mx.upcmail.net (vie01a-dmta-pe07-3.mx.upcmail.net [84.116.36.19]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7FADE689C57 for ; Tue, 31 Oct 2017 00:21:35 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1e9IRE-0006wd-Ox for ffmpeg-devel@ffmpeg.org; Mon, 30 Oct 2017 23:21:44 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id TyMi1w00t0S5wYM01yMj7p; Mon, 30 Oct 2017 23:21:43 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 30 Oct 2017 23:21:40 +0100 Message-Id: <20171030222141.18537-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.2 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/xan: Improve overlapping check X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Fixes: memcpy-param-overlap Fixes: 3612/clusterfuzz-testcase-minimized-6393461273001984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/xan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/xan.c b/libavcodec/xan.c index 4c01c0013f..8b4ec82405 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -263,7 +263,7 @@ static inline void xan_wc3_copy_pixel_run(XanContext *s, AVFrame *frame, prevframe_index = (y + motion_y) * stride + x + motion_x; prevframe_x = x + motion_x; - if (prev_palette_plane == palette_plane && FFABS(curframe_index - prevframe_index) < pixel_count) { + if (prev_palette_plane == palette_plane && FFABS(motion_x + width*motion_y) < pixel_count) { avpriv_request_sample(s->avctx, "Overlapping copy"); return ; }