1 Star 0 Fork 30

ycd21028/OpenEXR

forked from src-openEuler/OpenEXR 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2021-3478.patch 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
From bc88cdb6c97fbf5bc5d11ad8ca55306da931283a Mon Sep 17 00:00:00 2001
From: peterhillman <peterh@wetafx.co.nz>
Date: Fri, 20 Nov 2020 08:30:08 +1300
Subject: [PATCH] sanity check ScanlineInput bytesPerLine instead of lineOffset
size (#863)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com>
---
IlmImf/ImfScanLineInputFile.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/IlmImf/ImfScanLineInputFile.cpp b/IlmImf/ImfScanLineInputFile.cpp
index 649fc304b..54caec01d 100644
--- a/IlmImf/ImfScanLineInputFile.cpp
+++ b/IlmImf/ImfScanLineInputFile.cpp
@@ -1135,14 +1135,14 @@ void ScanLineInputFile::initialize(const Header& header)
_data->linesInBuffer) / _data->linesInBuffer;
//
- // avoid allocating excessive memory due to large lineOffsets table size.
+ // avoid allocating excessive memory due to large lineOffsets and bytesPerLine table sizes.
// If the chunktablesize claims to be large,
- // check the file is big enough to contain the table before allocating memory
+ // check the file is big enough to contain the lineOffsets table before allocating memory
// in the bytesPerLineTable and the lineOffsets table.
// Attempt to read the last entry in the table. Either the seekg() or the read()
// call will throw an exception if the file is too small to contain the table
//
- if (lineOffsetSize > gLargeChunkTableSize)
+ if (lineOffsetSize * _data->linesInBuffer > gLargeChunkTableSize)
{
Int64 pos = _streamData->is->tellg();
_streamData->is->seekg(pos + (lineOffsetSize-1)*sizeof(Int64));
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ycd21028/OpenEXR.git
git@gitee.com:ycd21028/OpenEXR.git
ycd21028
OpenEXR
OpenEXR
master

搜索帮助