From patchwork Sun Jul 22 20:23:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 9776 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp5029093jad; Sun, 22 Jul 2018 13:24:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe0xsf7iSiGm3RDX/O/L5DiOBxT2O734Ev1lNPv4lTR8k7A9cqCR/F3M2I13QtGnK4urhgW X-Received: by 2002:a1c:4d09:: with SMTP id o9-v6mr6434452wmh.111.1532291040849; Sun, 22 Jul 2018 13:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532291040; cv=none; d=google.com; s=arc-20160816; b=PG1T18rBQAcYH4fNOv+zk/QDsevE2voXjFjenA8emQcjZNgiUYmv5o96PkyHN/LuMd R/cRA1VkBhwcnepRPXxLRX1DkAS4IIzFh5ofmlP6U4dhElCZY72ngbqohfumq5NJpSMD 6WZZaGAKi5lr1aOKUlxJjt446rM9y68p1mdxFApwRvaa2EH2jovh97o91/deU8VLkFpl m50WAUYrfxCIC+5ZUOGCij+656Y8dmUFo3JkKFA+TnsxsWMP+1zBelBJvXe/FF7MOuSg YzgJlB+F5cj43b8iOOfxLA3p943T7a0JFNgSG8aAdyY7XGvh8FdRJwLf48RLdEZ/isvE A8qg== 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=UHNBTuGu3fcOORW9k5FWPYHWXJkXcMmTMFrF8BFAPR0=; b=B9DmsEkRwGYx9fx+D+8vNDRv2/hsSK/QD3WSRZKmVjBSbaV81EcQV5nXahi/bBSd+6 Y0rUNzjhCr+HJuD8Em1NeqLsm70K8JJRKMRnrpKMkEap42lI81TXWlvoXN7aSToHFfOO 5dtFAObmqOg5dmRz2xw67bQrMw5lJKTfml3GD2l7ukhyBBATTWdjgC/CzEf/LcUv9mfC kETMJZZI3qURgOggglBAZO+JrdJVPpR3Eq4Lo/CqOh8yvbV+cfBdau2cprh2Gee2Q3dj /nJz9MRDpqTJ74qdHJ3fDfFDBeZoV2LFq3qHM0DxjU+oZBJLbJTWsisKlx/4v4lgdaVJ TyJA== 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 e142-v6si4734087wmd.103.2018.07.22.13.24.00; Sun, 22 Jul 2018 13:24:00 -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 2AD4F689B63; Sun, 22 Jul 2018 23:23:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe08-1.mx.upcmail.net (vie01a-dmta-pe08-1.mx.upcmail.net [84.116.36.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 61CF1689B63 for ; Sun, 22 Jul 2018 23:23:33 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe08.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fhKtO-00074B-1S for ffmpeg-devel@ffmpeg.org; Sun, 22 Jul 2018 22:23:46 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id DwPe1y04k0S5wYM01wPflY; Sun, 22 Jul 2018 22:23:40 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 22 Jul 2018 22:23:18 +0200 Message-Id: <20180722202322.31933-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 Subject: [FFmpeg-devel] [PATCH 1/5] avcodec/diracdec: Prevent integer overflow in intermediate in global_mv() 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: signed integer overflow: -393471 * 5460 cannot be represented in type 'int' Fixes: 8890/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-6299775379963904 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/diracdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 753adeff61..e4cdd7ee2c 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -1399,8 +1399,8 @@ static void global_mv(DiracContext *s, DiracBlock *block, int x, int y, int ref) int *c = s->globalmc[ref].perspective; int m = (1<u.mv[ref][0] = (mx + (1<<(ez+ep))) >> (ez+ep); block->u.mv[ref][1] = (my + (1<<(ez+ep))) >> (ez+ep);