Comments (10)
My opinion is that it would be preferable to remove this dependency and leave it up to the user to include their zlib-compatible header (either zlib.h or miniz.h, as in my case) before including tinyexr.h.
This looks good so I made a change in the recent commit.
Thank you for reporting an issue!
from tinyexr.
I've also made similar changes on my side, where we have other modules in our code relying on miniz already.
We've basically removed lines 475 to 6909, and now only rely on:
#if TINYEXR_USE_MINIZ
#include <miniz/miniz.h>
#else
#include "zlib.h"
#endif
from tinyexr.
we have other modules in our code relying on miniz already.
Okay, I'm considering to introduce TINYEXR_USE_EXTERNAL_MINIZ
define, which assumes user code already includes miniz
header.
from tinyexr.
I don't see that it's necessary to add a new define, it's simpler just to disable the embedded version and require that the user included the header (or a compatible one) prior to including tinyexr.h. This relies on Miniz keeping a zlib-compatible interface but that's probably a safe assumption.
A key point for me is that I'd prefer not to have to modify tinyexr.h at all so that I can just drop in any updates.
from tinyexr.
I don't see that it's necessary to add a new define, it's simpler just to disable the embedded version and require that the user included the header (or a compatible one) prior to including tinyexr.h
I see. Let me give some time to figure out what is the best way to solve the issue with minimal modification.
from tinyexr.
Do you need miniz specific API for your project, @zigguratvertigo?
If you are ok to use zlib-compatible API, as @john-chapman suggests, there is no modification required anymore and you can include external miniz.h
as follows.
#include <miniz/miniz.h> // Use zlib compatible API
#define TINYDNG_USE_MINIZ (0) // Disable embedded miniz code in tinyexr.h
#include "tinyexr.h"
from tinyexr.
@syoyo One additional problem I noticed: there's a block of #pragma warning
starting line 4377 which is disabled with TINYEXR_USE_MINIZ
, but probably shouldn't be.
from tinyexr.
I see > there's a block of #pragma warning starting line 4377 which is disabled with TINYEXR_USE_MINIZ, but probably shouldn't be.
from tinyexr.
Fixed wrong pragma warning push/pop pair in this commit: 13a6b15
from tinyexr.
Plese reopen the issue if you still get a problem.
from tinyexr.
Related Issues (20)
- Warnings when compiling with VS2019 and W3 (32 bit) HOT 5
- Windows install HOT 1
- Heap-buffer-overflow exists in the DecompressPiz HOT 2
- 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
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.