Comments (6)
Can you confirm that PR #160 would fix this?
from cgltf.
To help out with this, I looked through all the occurrences of options->file.release
and options->memory.free
in cgltf.h. Assuming file.release
and memory.free
are not intended to be interchangeable (based on the issue #94 discussion here), then there may be two issues:
cgltf_parse_file()
gets afile_data
pointer usingfile.read
above. But this pointer is later passed to eithermemory_free
here if the parse fails, or passed tofile.release
incgltf_free()
here. (Looks like Johannes posted a fix right as I was writing this - I'll test it out!)- When reading buffers, buffers stored in files are read using
file.read
here, but Base64 buffers are decoded to a buffer allocated usingmemory.alloc
here. Both of these appear to be released usingfile.release
incgltf_free()
here (there's a special case for the .glb binary section which gets handled correctly!)
Also - thanks very much; I'll test out the PR and hopefully it should fix the cgltf_parse_file()
issue!
from cgltf.
Funny that this all comes up now. Your second bullet point is the same as #158, is that correct?
from cgltf.
Oh, yep, looks like that is indeed the same issue!
Also, I can confirm that PR #160 fixes the cgltf_parse_file()
issue with custom file callbacks and invalid glTF files - thank you, Johannes!
from cgltf.
I think in that case we don't have much of a choice except for tracking where the data comes from. I've added another change to #160. Does that help?
from cgltf.
we didn't run into #158 but your fixes looks good
from cgltf.
Related Issues (20)
- cgltf_image::buffer_view::data is null HOT 2
- glb binary texture data HOT 4
- cgltf_write accessor is missing stride property HOT 1
- cgltf_write to buffer ignores options -> can't create an in-memory GLB
- write buffer_view should write TARGET
- The reference information regarding the use of cgltf_load_buffer_base64 is unclear
- Extras for cgltf_light are ignored while writing
- 2 GB+ json parser support HOT 5
- Loading this file causes a crash. HOT 4
- Suggestion: store indices instead of pointers in the data structures HOT 4
- Add support for MSFT_texture_dds extension HOT 1
- Potential Undefined Behaviour in "cgltf_component_read_index"
- How to enable draco support? HOT 3
- fopen or strcpy this function or variable is unsafe. HOT 1
- Library will not compile if using GCC in Windows.
- Node parent sanity check prevents loading files created with UniGLTF-1.27 HOT 5
- different joints for same primitive
- Stack allocate cgltf_data structure? HOT 1
- Possible to have individual flags for metallic and roughness? HOT 4
- Invalid gltf file with EXT_mesh_gpu_instancing HOT 2
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 cgltf.