From patchwork Sat Sep 15 00:08:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 10329 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp1156281jap; Fri, 14 Sep 2018 17:09:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYJZI7CcohsB4tJCk/4eAOQ9VJZYO8CCYrnO0SzN7bQS2y1GJquzwGF+W7a6Cd7ZwtVSFtA X-Received: by 2002:a1c:1d0:: with SMTP id 199-v6mr4155333wmb.2.1536970163850; Fri, 14 Sep 2018 17:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536970163; cv=none; d=google.com; s=arc-20160816; b=UPvNMrTdSLHANp1p57VVz4VMCfgw+mAfi01ST20dI+rJ7TCgXLGOvtQt05ZFu3J8Ox xH1yM/1obS9OXWmg6ZCmCReZ+g8NCe25NwzvH7DPm1ZS/shXULrCsb0VdnO2Li91WXjN le++Yomc9uxHiszsk/9bU5Va6euaZBuqE9EilEl//1sOBVQ0yLdCuwKQCuOU9ufY8AMO 4LHpoOtwvu1qjXXb+t3zs9F9CSeODFhi8QvFdAp9NO2O5dIWVgM2ifZKj3XHQX7xy9TP gtc3c5QnODybYeqDVeZh6bfkTpUex0r3CKRlbYGwL4lH7Sq2RjMGR6Am/p2CGVbI7rLy 1ZzQ== 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=sG061wIQOr2t85MO1krLJtJ8ZkpEnn8LexpX8SgTgZw=; b=gd6zgeDFrPDULXqp2hNWILXlT8swmKL5+x1nls0t1pj0j8YmspaYeTOMvDuiMg/Gkx SyujC8jsOif8rw7v0D7MbKbCoIa6+Atm6cT2MUnBTfbg5qt8b2ymwFYascAfAt5xHj87 4lvnllZFpZYtvj6JFXDj8w6X16nE5J2buIQ0IOkTpQEcIJOZhP984X6uvoHkDKAYHZNH wOphw5WAhwvSpaONudDRrnqA3iPflg4mWAXIaBUu++pr7e+kYWB7Ed1RITfL8RqJNjAQ p58REay/Pp9mafiil6qW0SDMLDesErgD5HRdCJe4piNtbPW4Wh+5vJGRTfQtIo8F3G7J oXEg== 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 b8-v6si8360921wrf.37.2018.09.14.17.09.23; Fri, 14 Sep 2018 17:09:23 -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 01D4068A6BB; Sat, 15 Sep 2018 03:09:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-1.mx.upcmail.net (vie01a-dmta-pe05-1.mx.upcmail.net [84.116.36.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6D69D68A5BD for ; Sat, 15 Sep 2018 03:08:55 +0300 (EEST) 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 1g0y94-0003TS-BA for ffmpeg-devel@ffmpeg.org; Sat, 15 Sep 2018 02:09:06 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id bc921y00G0S5wYM01c93Vt; Sat, 15 Sep 2018 02:09:03 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 15 Sep 2018 02:08:22 +0200 Message-Id: <20180915000822.1017-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180915000822.1017-1-michael@niedermayer.cc> References: <20180915000822.1017-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/mpeg4videodec: Fix undefined shift in get_amv() 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: shift exponent -1 is negative Fixes: 9938/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5653783529914368 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/mpeg4videodec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 853c6d9132..f435a520c8 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -598,7 +598,7 @@ static inline int get_amv(Mpeg4DecContext *ctx, int n) len >>= s->quarter_sample; if (s->real_sprite_warping_points == 1) { - if (ctx->divx_version == 500 && ctx->divx_build == 413) + if (ctx->divx_version == 500 && ctx->divx_build == 413 && a >= s->quarter_sample) sum = s->sprite_offset[0][n] / (1 << (a - s->quarter_sample)); else sum = RSHIFT(s->sprite_offset[0][n] * (1 << s->quarter_sample), a);