Skip to content

Conversation

@jasperdewinther
Copy link
Contributor

@jasperdewinther jasperdewinther commented Dec 8, 2024

For a while we have not been able to load blosc encoded files. But that time is no more. After a significant debugging session I found out that OpenVDB does hit this check https://github.com/AcademySoftwareFoundation/openvdb/blob/master/openvdb/openvdb/io/Compression.h#L308 and does an early out if count == 0. We didnt do this check resulting in us reading num_compressed_bytes from the reader, reading garbage and offsetting the reader incorrectly.

I validated the results against one frame of each of JangaFX's free download models, specifically the ones listed below:
image
All these models now load correctly. yay.

The main problematic files remaining are specific exports I made myself with Houdini. These models use f32 for the voxel values, unlike Embergen, which uses f16.

This PR fixes #33

@jasperdewinther jasperdewinther merged commit 632f3f5 into main Dec 8, 2024
4 checks passed
@jasperdewinther jasperdewinther deleted the fix-blosc branch December 8, 2024 17:21
@Jasper-Bekkers
Copy link
Member

Glad to see that you already resolved and ninja-merge this before I could even get to the bottom of that T::zeroed(); discard 🤷 👍

That investigation can easily happen async an decoupled from this PR. As the code got fixed before merging.

src/reader.rs Outdated
count: usize,
) -> Result<Vec<T>, ParseError> {
if count == 0 {
return Ok(vec![T::zeroed(); count]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya that didn't make sense. I am constructing an empty vec now.

@jasperdewinther
Copy link
Contributor Author

I'm sorry, at the time of merging I didnt know you were still reviewing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allocation failure on parsing of BLOSC compressed VDB data

2 participants