Comments (6)
I have investigated your EXR file and offset tables looks corrupted.
http://www.openexr.com/openexrfilelayout.pdf (See page 10 for Offset tables)
First element of offset tables contains the byte offset to 1023th scanline correctly, but other elements are filled with zeros, so tinyexr reads pixel data from invalid location, resulting an assertion.
Also, exrheader
program from OpenEXR displays your EXR is incomplete.
$ exrheader sample-tinyexr-bug.exr
file sample-tinyexr-bug.exr (incomplete):
file format version: 2, flags 0x0
channels (type chlist):
B, 16-bit floating-point, sampling 1 1
G, 16-bit floating-point, sampling 1 1
R, 16-bit floating-point, sampling 1 1
compression (type compression): run-length encoding
dataWindow (type box2i): (0 0) - (1023 1023)
displayWindow (type box2i): (0 0) - (1023 1023)
lineOrder (type lineOrder): increasing y
pixelAspectRatio (type float): 1
screenWindowCenter (type v2f): (0 0)
screenWindowWidth (type float): 1
type (type string): "scanlineimage"
How do you create your EXR file?
(For some reason, it looks OpenEXR can handle such an incomplete data, whereas tinyexr is not)
from tinyexr.
BTW I have found another issue related RLE, filed as #35
(FYI, offset tables in comp_rle.exr are correct, thus issue #35 looks purely the problem of RLE decoding)
from tinyexr.
The file was produced by a legacy toolchain, so I don't exactly have control over it. Anyway, I will see whether I can hack around the issue.
from tinyexr.
I found OpenEXR try to reconstruct offset information for incomplete EXR file.
(i.e. offset is zero)
https://github.com/openexr/openexr/blob/develop/OpenEXR/IlmImf/ImfScanLineInputFile.cpp#L338
And adding similar code to tinyexr
, now your file can be read correctly.
BTW, Is it ok to add your EXR file to unit tests? @zeroeffects
from tinyexr.
It seems that the latest version is crashing with null pointer dereference in rleDecompress.
Also, you can use the image. It is a rectified image of alcantara material measured in camera dome under specific lighting and viewing conditions.
from tinyexr.
Ah, I found memory bug and fixed it. Now recent master
should work.
Also, you can use the image.
Thank you. But I found the image has 5.8MB which is too large to add into tinyexr
repo. Do you have much more smaller one? (e.g. 0.5 MB or less)
from tinyexr.
Related Issues (20)
- Heap-buffer-overflow exists in the DecodePixelData HOT 2
- [TODO] Support nested layer name
- Got "-Wreserved-identifier" compiler warning when compiling with Clang-13.0.1 HOT 4
- Use wuffs for fast & secure ZIP/LZW decoding/encoding HOT 3
- UBSan issue when loading an .exr HOT 2
- compilation error on 1.0.1 with ZFP HOT 2
- "Failed to read attribute" error message on Big Endian platform? HOT 2
- [TODO] Setup Github Actions CI build
- memory error in tinyexr::InitSingleResolutionOffsets HOT 3
- [TODO] [Improve Security] Remove assert HOT 1
- PIZ decompression error with tinyexr 1.0.2 HOT 5
- Three Bugs in tinyexr.h HOT 2
- [TODO] Memory limit feature HOT 4
- SEGV on unknown address in tinyexr.h:5779 HOT 2
- allocator is out of memory HOT 1
- Problems decoding several OpenEXR reference files HOT 2
- The vulnerability is a memory leak bug located at line 9291 of the file /tinyexr/tinyexr.h
- Clang compiler settings break clang-cl compilation on windows HOT 3
- Not compiling on macOS with clang 18.1.8 HOT 1
- [TODO] support deepscanline format
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinyexr.