1 Star 0 Fork 30

jackie_wu123/OpenEXR

forked from src-openEuler/OpenEXR 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2021-3475-pre0.patch 888 Bytes
一键复制 编辑 原始数据 按行查看 历史
From d548fd5eb04d62ad65db18e6425a36e7ab6645dc Mon Sep 17 00:00:00 2001
From: Cary Phillips <[email protected]>
Date: Sat, 8 Aug 2020 16:27:03 -0700
Subject: [PATCH] Avoid integer overflow in calculateNumTiles()
Signed-off-by: Cary Phillips <[email protected]>
---
IlmImf/ImfTiledMisc.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/IlmImf/ImfTiledMisc.cpp b/IlmImf/ImfTiledMisc.cpp
index 8552ada20..1cff8037d 100644
--- a/IlmImf/ImfTiledMisc.cpp
+++ b/IlmImf/ImfTiledMisc.cpp
@@ -301,7 +301,11 @@ calculateNumTiles (int *numTiles,
{
for (int i = 0; i < numLevels; i++)
{
- numTiles[i] = (levelSize (min, max, i, rmode) + size - 1) / size;
+ int l = levelSize (min, max, i, rmode);
+ if (l >= std::numeric_limits<int>::max() - size + 1)
+ throw IEX_NAMESPACE::ArgExc ("Invalid size.");
+
+ numTiles[i] = (l + size - 1) / size;
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jackie_wu123/OpenEXR.git
[email protected]:jackie_wu123/OpenEXR.git
jackie_wu123
OpenEXR
OpenEXR
master

搜索帮助