1 Star 0 Fork 30

jackie_wu123/OpenEXR

forked from src-openEuler/OpenEXR 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2021-3474.patch 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
From c3ed4a1db1f39bf4524a644cb2af81dc8cfab33f Mon Sep 17 00:00:00 2001
From: Peter Hillman <[email protected]>
Date: Mon, 17 Aug 2020 12:29:03 +1200
Subject: [PATCH] compute Huf codelengths using 64 bit to prevent shift
overflow
Signed-off-by: Peter Hillman <[email protected]>
---
OpenEXR/IlmImf/ImfFastHuf.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/IlmImf/ImfFastHuf.cpp b/IlmImf/ImfFastHuf.cpp
index 9ccf2e15d..c04b56e75 100644
--- a/IlmImf/ImfFastHuf.cpp
+++ b/IlmImf/ImfFastHuf.cpp
@@ -205,7 +205,7 @@ FastHufDecoder::FastHufDecoder
for (int l = _minCodeLength; l <= _maxCodeLength; ++l)
{
countTmp[l] = (double)codeCount[l] *
- (double)(2 << (_maxCodeLength-l));
+ (double)(2ll << (_maxCodeLength-l));
}
for (int l = _minCodeLength; l <= _maxCodeLength; ++l)
@@ -215,7 +215,7 @@ FastHufDecoder::FastHufDecoder
for (int k =l + 1; k <= _maxCodeLength; ++k)
tmp += countTmp[k];
- tmp /= (double)(2 << (_maxCodeLength - l));
+ tmp /= (double)(2ll << (_maxCodeLength - l));
base[l] = (Int64)ceil (tmp);
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jackie_wu123/OpenEXR.git
[email protected]:jackie_wu123/OpenEXR.git
jackie_wu123
OpenEXR
OpenEXR
master

搜索帮助