From patchwork Fri May 3 21:55:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48483 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:e68f:b0:1af:836d:81b3 with SMTP id mz15csp69028pzb; Fri, 3 May 2024 14:55:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUStPQc8M1qkI6AMZhQoVBhS4IO0DbkM0t7dQaalLKuGo0AJBx2kDd//iAmney3o9m3WYsjzCpwOOutAdaozfRbaHQHtS/Cp5mzzw== X-Google-Smtp-Source: AGHT+IEmclfgHEPKxVD9OzgejIFMwRaIBNxNy2gnqHWEAKtmZPtYFL9s8TCNu6sHRy6MbJGAOH6z X-Received: by 2002:a05:6402:4495:b0:572:5796:85fb with SMTP id er21-20020a056402449500b00572579685fbmr2134054edb.4.1714773352340; Fri, 03 May 2024 14:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714773352; cv=none; d=google.com; s=arc-20160816; b=vI31KW65WdX1LkKw8/pqA2vxUbKvGglIFqBSueRPlBNaelM+GXldUKZRBPH5c/6lwr vRJlNtbX3m7sIjsiF5DTeJGJEmGg1wI4mt4rbDueFESvtyUQK1OO6wiAcqE1HjReWnoC ZYU9U5PmLikUGaVmB5IVCJUsA1thEObE/cOSKfVT783khIibE8tD2J+xrSJbi4BSJqt2 6kJ5okWPr45CvMVtEq0eq0vJyiYXKd8FN8RflMWSXZD06ANSdjsHjsv16DSAjfzxBCDO 6Njs86lfyi2o25NdAJ7pPe39MrKxuLqYRJOD+b5WY297PURd1L4aYeuVpUnsJwwopjfa x53A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=5luuatb4bfQrSFVKtGTAgkMpSIyEa0LTIAn9DQrhfPI=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=zEV1KF/tgjdJfMXi3LfrwgYJ4jG0JNn4BwWOy66GuAYbo8cfOiDWrVolsIxPZdei4U x67tvB0d6DgipfeWxJ9jk1a5gbneOgd1mJMkwXJpjvfZaJSa0il5hvjHiVHUoAQAk4xk 57CysToIZ9vp0QJilM7JLeoJ59tvJjYWcn/o4zbTOMvMwuYtr21ENFOMoPhd772laAUB /fpw6fyi4fW/JF+WI8oJlrtpvtZ551QWKJGHFt7FUbMcqmFBxHzVqo+9i48lTWatgg6Y lXEAifYqyH6wgaGq+AOAIDMmMfFCbivRJXKdhXRQOoUS7QuT/S5Cx+4RxtjXIDn7Kih+ 2Yjw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b="dloY1VP/"; 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 bx18-20020a0564020b5200b00572207fd7e2si1864145edb.184.2024.05.03.14.55.51; Fri, 03 May 2024 14:55:52 -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; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b="dloY1VP/"; 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 1837C68D731; Sat, 4 May 2024 00:55:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6200768D71C for ; Sat, 4 May 2024 00:55:09 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2CF3420003 for ; Fri, 3 May 2024 21:55:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714773308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xb2Y/kNRKgPB1pSf6dE7oWOvtq1UeUMXLgzzOvqM4hA=; b=dloY1VP/SV4goQh1PkaOeYZPhtoI/nt4b2pqU4uz1T5Jbc22eD+Bl4oHNx7eqOLKq/S6pT bUbQgBYQRLaR4B0Ms9GmbgEezGDxkJTmKKO0AOL7plZJxnD4L2HOI40RCMbtnziTWHZDZ/ KrevpjI/LFHGjjBq+w+D1Nw/0yGLf/j5ek/8ROcoJ/b+vkKF9fBPeYeT9mc2BkrdIPuM4o RsIIiWknzsq6HSKSUsFt1Y0VNnSf9rLXKYg2HUpnz6lG5A7SlDsVhvD3r24WaY0CgYB8nF w7qbJrxaqzv2YNbeSODus1JU9Jwb6AiVrwWgpJcjeAR844PREA9067nCAN+BXA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 3 May 2024 23:55:02 +0200 Message-ID: <20240503215502.1509887-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240503215502.1509887-1-michael@niedermayer.cc> References: <20240503215502.1509887-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 5/5] avcodec/exr: Fix preview overflow X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: JkbIbfKYGCPl Fixes: CID1515456 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund 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 8bd39f78a45..4bac0be89b2 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -1943,7 +1943,7 @@ static int decode_header(EXRContext *s, AVFrame *frame) "preview", 16)) >= 0) { uint32_t pw = bytestream2_get_le32(gb); uint32_t ph = bytestream2_get_le32(gb); - uint64_t psize = pw * ph; + uint64_t psize = pw * (uint64_t)ph; if (psize > INT64_MAX / 4) { ret = AVERROR_INVALIDDATA; goto fail;