From patchwork Thu Aug 17 01:54:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4728 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.46.211 with SMTP id u202csp1413937vsu; Wed, 16 Aug 2017 18:55:26 -0700 (PDT) X-Received: by 10.223.175.21 with SMTP id z21mr2477795wrc.145.1502934925980; Wed, 16 Aug 2017 18:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502934925; cv=none; d=google.com; s=arc-20160816; b=RN7pzqiMLONclCbKSrMwvfixzbT28iDg9QdxMRo0KAIN8kkrZGggIKR8jKMc+R3lNp O1Uk3GPTO8SKVS4QwCrK9zXXQAf4Uqp5Ain/cStwQ6L7TrIQM1o+S0sWOil4WZ+QhB2X bSS6Xich4hUmshkDZcZrCUmsydQCDfKCNZnuylWQ4CEX73yaSYZZpMvXlv9JZG2WJKOt Y13ZEBZDRYzzxuqP3Ks/i1MIdBD0agWJBzk1DxYe0P0m37QMlBuZaRWlexkK+wvfFafB n3yhlkuRe1PeRU1Td3EGFvMXiqgkOmJKm3cgggqx8jpvzkUegYYlu+WhfUU8R+hI+O0X nEDg== 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=NdM9rUHeI8f/6+MbM0lL1JsKagfMPc4rlkGb1DY+gMY=; b=IGbEf4f53TJYJ99XU/lePCxysku7Cie2txwU+1ysVmDkg4AaUC/28NxVj0LY4TywGe 6NBJT6YEAUvRf6Bo+a+ESZbVlPG8IGErdjUsIzxlqVBWtNaOogtkda4ZNYH/YXKGEK72 a8msqeh/+PLh7f9DymSVOtA43/Kg60gwoi5f0C5VooTqDGxWWXxxFhvBbt7WNbGlEwsS psPiab+5/qlUYhKV0vN/wD/PCgu6OUZ46Lp98Ai0lcAxmRiBvPHccaVzAbvHFz5eGbXp 5q/v0jwUD1Gv8256KTHXdXdKaiqRQs1eyEaeztFOJXAZk7JxVGCC5xIEDTOxoASRpst3 nbqg== 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 i7si978333wme.21.2017.08.16.18.55.25; Wed, 16 Aug 2017 18:55:25 -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 6480C689784; Thu, 17 Aug 2017 04:55:10 +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-pe06-1.mx.upcmail.net [84.116.36.14]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9A6D6688270 for ; Thu, 17 Aug 2017 04:55:04 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1diA1d-000647-59 for ffmpeg-devel@ffmpeg.org; Thu, 17 Aug 2017 03:55:09 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id y1uy1v00k0S5wYM011uz6y; Thu, 17 Aug 2017 03:55:00 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 17 Aug 2017 03:54:56 +0200 Message-Id: <20170817015457.6723-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.1 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/pixlet: fixes integer overflow in read_highpass() 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: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself Fixes: 2879/clusterfuzz-testcase-minimized-6317542639403008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/pixlet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c index a9661d3ab6..088226bdda 100644 --- a/libavcodec/pixlet.c +++ b/libavcodec/pixlet.c @@ -331,6 +331,9 @@ static int read_highpass(AVCodecContext *avctx, uint8_t *ptr, int plane, AVFrame return AVERROR_INVALIDDATA; } + if (a == INT32_MIN) + return AVERROR_INVALIDDATA; + ret = read_high_coeffs(avctx, ptr + bytestream2_tell(&ctx->gb), dest, size, c, (b >= FFABS(a)) ? b : a, d, ctx->band[plane][i + 1].width, stride);