htj2k: Check for duplication file_index values when reading file header#2516
htj2k: Check for duplication file_index values when reading file header#2516palemieux wants to merge 2 commits into
Conversation
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
kdt3rd
left a comment
There was a problem hiding this comment.
I'd really like to continue to try to move towards avoiding short lifetime heap allocations, and get back to the idea that the core library allows you to replace the memory allocator, replace the readers / writers, and you can make an embedded version of the core library work without going through the entire library (i.e. so someone could just use the exr library on an embedded device like a camera - we're not there yet, but it is a decent design goal, and makes the library a better citizen in the massively multi-threaded world we live in)
|
|
||
| map.resize (header.pull_uint16 ()); | ||
| map.resize (header.pull_uint16 (), {-1, 0}); | ||
| std::unordered_set<int> seen(map.size()); |
There was a problem hiding this comment.
can we do this without extra memory allocs every chunk read (see my comment on 2515)
There was a problem hiding this comment.
It is possible but will result in less maintainable and less readable code. Is this the right tradeoff? If yes, I am happy to implement it.
Replaces #2515