From patchwork Thu Nov 30 22:58:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 6480 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp451091jah; Thu, 30 Nov 2017 14:58:33 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ1p9TyKnLjiUk3In+0IPEIWtfcgslJbAJvtjkgYq/j+5PpIr5c6ueE1FKAS0DwbAovS+2i X-Received: by 10.223.131.129 with SMTP id 1mr3325717wre.205.1512082713584; Thu, 30 Nov 2017 14:58:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512082713; cv=none; d=google.com; s=arc-20160816; b=JNy6nWyFYR65aiXaILTSOCKzG6NxJVxBP7VZeCYxFuZ1XT2VjpgHL/mPCi8Nj7xo/G pG16Ou45wV2qxgTbTaZDZXCGw+vexU+C9xPKZSF22lysdU9IU8j/KtPXOeXT2BqM+PMk EOTaUgbEBCMv2dL2uDb+Z0jaNXiCfFwxF8ycGE9Xm2P0OR0S9VcsRrFn1EcZDQbKn0O4 z9csCg299HpOSaq/eEhYYmJ8bNirPXHyOMy/Z+YmzNPUMjpTvWjieDagIJAojCctqpiH GIIwJwNYYZdxvhTeVpNBKqg3b/t8db3E9O8HcfEKzRIjmDh0siDn4bgFMzJFMfLOio/9 GwvQ== 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=PYPb7/1syAycu31kJ9IJtUPxQ0WTC1UlGwa6OpK94Ok=; b=SDexUHO02svqqYDJ1mYe9fgcbKEs4JP0XRADtlTDjeGpjT1MpiT/M+rVb3XwgyGEjp OeZ7hNqYzSuIhDKSj6zmynDLmenG5rzfljPWeD7FPOi0CrB3TIPHO0XSmY/o9DEjNVXv cmFmz2RVktas2WtZw5dltXcqBXgKnL7nBSQ0B0yFDKss2vxnkwQYVkkfaNk9yo2kJeK0 Wyc6pZMiwBZu0517JM/8FowLzIVgUXfvL6Qrjmc2ulYsTvqNOI8HPqwwRhMnXREL+p8m O8HJVvoE4vv5O+K/cTZc7Xh0l5UtlYi5cg6h0krzPSLs6215ZxxfD46yH/DthXPKcf14 LXzw== 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 n2si3891895wmc.106.2017.11.30.14.58.32; Thu, 30 Nov 2017 14:58:33 -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 2875968A3CA; Fri, 1 Dec 2017 00:58:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-2.mx.upcmail.net (vie01a-qmta-pe02-2.mx.upcmail.net [62.179.121.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E79B68A3AB for ; Fri, 1 Dec 2017 00:58:21 +0200 (EET) Received: from [172.31.218.43] (helo=vie01a-dmta-pe05-1.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eKXmi-0001eu-Ls for ffmpeg-devel@ffmpeg.org; Thu, 30 Nov 2017 23:58:24 +0100 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eKXmc-0005cz-VO for ffmpeg-devel@ffmpeg.org; Thu, 30 Nov 2017 23:58:18 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id gNyC1w00t0S5wYM01NyDQM; Thu, 30 Nov 2017 23:58:13 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 30 Nov 2017 23:58:09 +0100 Message-Id: <20171130225811.13103-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.15.0 Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/hevcdsp_template: Fix undefined shift in put_hevc_epel_bi_w_h() 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: runtime error: left shift of negative value -127 Fixes: 4397/clusterfuzz-testcase-minimized-4779061080489984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/hevcdsp_template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c index 46a0da2045..0623cfad89 100644 --- a/libavcodec/hevcdsp_template.c +++ b/libavcodec/hevcdsp_template.c @@ -1355,7 +1355,7 @@ static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint for (y = 0; y < height; y++) { for (x = 0; x < width; x++) dst[x] = av_clip_pixel(((EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) * wx1 + src2[x] * wx0 + - ((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1)); + ((ox0 + ox1 + 1) * (1 << log2Wd))) >> (log2Wd + 1)); src += srcstride; dst += dststride; src2 += MAX_PB_SIZE;