From patchwork Sat Nov 4 00:19:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 5850 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp453056jah; Fri, 3 Nov 2017 17:19:57 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QdOUQiX3dHAD49fBkGwlaO6U5eN3ArfMxR8vl6VsRoPGxPCXW7p89qdXprIHKFN/i8gQGM X-Received: by 10.28.238.27 with SMTP id m27mr357967wmh.47.1509754796939; Fri, 03 Nov 2017 17:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509754796; cv=none; d=google.com; s=arc-20160816; b=oVCKjbS3lKPJJr3I6MqR8Sx5tEGooSEoSh1tgsSmdFOewsrSlLpo1JjE1iryxQx5aC rsrWTcXePsl1xxjw3iOz10mv/3mn5RWjRuX+5b9jvYyGhAkW0b9eSVdloGJ2Fn8JwI4s hwDBZ3gVqWhc9r3+xeJCm/qe8YT8T/2SC74TPaDTgh1FIsnWXSsnYyQBMSLXsJxnjxQg CgNDuObvWB7eahxsuRUTR0YFyFR+ypDZ72x9nCEAtkrz8TPCrD4k3So4YaioW9NtlyM/ MFg1uGRTXQvfbsbaKTRqatYwzL8GUtMg4Z6EtzwRIRFt9RDzXsEIQMJBhjWCGVvBJoUi /8Nw== 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=BsizoADjSU9gcm3U4BrN7iBwc7H2f5KpXbhxHnpLkug=; b=w2hCyWn+RkY+nkaoPU40tYRiV5JnHxSdkWoWbCSTkBGzSQq2tbpdrAstbY4tOhP4zn vv1Dfo5/6nr6CvwTM+Xi4Up0G2bIZ4f82A3d59aW9Gebp9AiokuUqweXWIoBBKkCici5 p+BPbvXbDKwQ6+lQOhfUOeLvgjlVHpAtifhKY6oO3pBcDtoOWXhdj0xAwZFs/wMqw8/z sRk+NtiPu6Mv/jdubz79MPaIE/y2OGZevek2/4ZzCOW0IRZtsxYSnOct41IjVPLiOocX wlk+N4H+nbedjQBEI6nrxgfwloA5mdCHpMxKa6zSD1bDXPvqN0N4xrmnV1CAlwOaLSqY k+Og== 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 k1si6387298wrh.398.2017.11.03.17.19.56; Fri, 03 Nov 2017 17:19:56 -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 4C03B689F52; Sat, 4 Nov 2017 02:19:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-3.mx.upcmail.net (vie01a-qmta-pe02-3.mx.upcmail.net [62.179.121.183]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 88BE2689E18 for ; Sat, 4 Nov 2017 02:19:24 +0200 (EET) Received: from [172.31.218.34] (helo=vie01a-dmta-pe02-1.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eAmBT-00044p-BW for ffmpeg-devel@ffmpeg.org; Sat, 04 Nov 2017 01:19:35 +0100 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eAmBN-00031S-Lh for ffmpeg-devel@ffmpeg.org; Sat, 04 Nov 2017 01:19:29 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id VcKN1w00o0S5wYM01cKPRj; Sat, 04 Nov 2017 01:19:23 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 4 Nov 2017 01:19:19 +0100 Message-Id: <20171104001921.24006-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.15.0 Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/exr: fix undefined shift in pxr24_uncompress() 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 255 by 24 places cannot be represented in type 'int' Fixes: 3787/clusterfuzz-testcase-minimized-5728764920070144 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/exr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 0b755db3cb..b1ecde4ebd 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -855,7 +855,7 @@ static int pxr24_uncompress(EXRContext *s, const uint8_t *src, in = ptr[2] + td->xsize; for (j = 0; j < td->xsize; ++j) { - uint32_t diff = (*(ptr[0]++) << 24) | + uint32_t diff = ((unsigned)*(ptr[0]++) << 24) | (*(ptr[1]++) << 16) | (*(ptr[2]++) << 8); pixel += diff;