Skip to content

Commit

Permalink
asset: Fix crash when gltf transient allocator runs out of space (#1046)
Browse files Browse the repository at this point in the history
  • Loading branch information
BastianBlokland authored Sep 22, 2024
1 parent 60c9274 commit 5b82edc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libs/asset/src/loader_mesh_gltf.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,10 @@ static Mem gtlf_uri_data_resolve(GltfLoad* ld, String uri) {
if (!size) {
return mem_empty;
}
const Mem res = alloc_alloc(ld->transientAlloc, size, 16);
const Mem res = alloc_alloc(ld->transientAlloc, size, 16);
if (!mem_valid(res)) {
return mem_empty; // Transient allocator ran out of space. TODO: Report proper error.
}
DynString writer = dynstring_create_over(res);
if (!base64_decode(&writer, uri)) {
return mem_empty;
Expand Down

0 comments on commit 5b82edc

Please sign in to comment.