Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VOXELFORMAT: VOX: assert hit #226

Closed
mgerhardy opened this issue Feb 4, 2023 · 0 comments
Closed

VOXELFORMAT: VOX: assert hit #226

mgerhardy opened this issue Feb 4, 2023 · 0 comments

Comments

@mgerhardy
Copy link
Collaborator

ERROR: (0) #10   Source "/home/mgerhardy/dev/engine/src/modules/voxelformat/VoxFormat.cpp", line 267, in loadGroupsPalette
ERROR: (0)         264: 		return false;
ERROR: (0)         265: 	}
ERROR: (0)         266: 	const uint32_t ogt_vox_flags = k_read_scene_flags_groups | k_read_scene_flags_keyframes | k_read_scene_flags_keep_empty_models_instances;
ERROR: (0)       > 267: 	const ogt_vox_scene *scene = ogt_vox_read_scene_with_flags(buffer, size, ogt_vox_flags);
ERROR: (0)         268: 	core_free(buffer);
ERROR: (0)         269: 	if (scene == nullptr) {
ERROR: (0)         270: 		Log::error("Could not load scene %s", filename.c_str());
ERROR: (0) #9    Source "/home/mgerhardy/dev/engine/src/modules/voxelformat/external/ogt_vox.h", line 1741, in ogt_vox_read_scene_with_flags
ERROR: (0)        1739:             _vox_array< const _vox_scene_node_*> stack;
ERROR: (0)        1740:             stack.reserve(64);
ERROR: (0)       >1741:             generate_instances_for_node(stack, nodes, 0, child_ids, model_ptrs, instances, misc_data, groups, k_invalid_group_index, generate_keyframes);
ERROR: (0)        1742: 
ERROR: (0)        1743:             // if caller doesn't want groups, we flatten out transforms for all instances and parent them to a single group
ERROR: (0)        1744:             if (!generate_groups) {
ERROR: (0) #8    Source "/home/mgerhardy/dev/engine/src/modules/voxelformat/external/ogt_vox.h", line 1027, in generate_instances_for_node
ERROR: (0)        1024:             case k_nodetype_transform:
ERROR: (0)        1025:             {
ERROR: (0)        1026:                 stack.push_back(node);
ERROR: (0)       >1027:                 generate_instances_for_node(stack, nodes, node->u.transform.child_node_id, child_id_array, model_ptrs, instances, misc_data, groups, group_index,  generate_keyframes);
ERROR: (0)        1028:                 stack.pop_back();
ERROR: (0)        1029:                 break;
ERROR: (0)        1030:             }
ERROR: (0) #7    Source "/home/mgerhardy/dev/engine/src/modules/voxelformat/external/ogt_vox.h", line 1064, in generate_instances_for_node
ERROR: (0)        1061:                 stack.push_back(node);
ERROR: (0)        1062:                 const uint32_t* child_node_ids = (const uint32_t*)& child_id_array[node->u.group.first_child_node_id_index];
ERROR: (0)        1063:                 for (uint32_t i = 0; i < node->u.group.num_child_nodes; i++) {
ERROR: (0)       >1064:                     generate_instances_for_node(stack, nodes, child_node_ids[i], child_id_array, model_ptrs, instances, misc_data, groups, next_group_index, generate_keyframes);
ERROR: (0)        1065:                 }
ERROR: (0)        1066:                 stack.pop_back();
ERROR: (0)        1067:                 break;
ERROR: (0) #6    Source "/home/mgerhardy/dev/engine/src/modules/voxelformat/external/ogt_vox.h", line 1027, in generate_instances_for_node
ERROR: (0)        1024:             case k_nodetype_transform:
ERROR: (0)        1025:             {
ERROR: (0)        1026:                 stack.push_back(node);
ERROR: (0)       >1027:                 generate_instances_for_node(stack, nodes, node->u.transform.child_node_id, child_id_array, model_ptrs, instances, misc_data, groups, group_index,  generate_keyframes);
ERROR: (0)        1028:                 stack.pop_back();
ERROR: (0)        1029:                 break;
ERROR: (0)        1030:             }
ERROR: (0) #5    Source "/home/mgerhardy/dev/engine/src/modules/voxelformat/external/ogt_vox.h", line 1021, in generate_instances_for_node
ERROR: (0)        1018:         _vox_array<const _vox_scene_node_*> & stack, const _vox_array<_vox_scene_node_> & nodes, uint32_t node_index, const _vox_array<uint32_t> & child_id_array, const _vox_array<ogt_vox_model*> & model_ptrs,
ERROR: (0)        1019:         _vox_array<ogt_vox_instance> & instances, _vox_array<char> & misc_data, _vox_array<ogt_vox_group>& groups, uint32_t group_index, bool generate_keyframes)
ERROR: (0)        1020:     {
ERROR: (0)       >1021:         const _vox_scene_node_* node = &nodes[node_index];
ERROR: (0)        1022:         switch (node->node_type)
ERROR: (0)        1023:         {
ERROR: (0)        1024:             case k_nodetype_transform:
ERROR: (0) #4    Source "/home/mgerhardy/dev/engine/src/modules/voxelformat/external/ogt_vox.h", line 780, in operator[]
ERROR: (0)         777:             return data[index];
ERROR: (0)         778:         }
ERROR: (0)         779:         const T& operator[](size_t index) const {
ERROR: (0)       > 780:             ogt_assert(index < count, "index out of bounds");
ERROR: (0)         781:             return data[index];
ERROR: (0)         782:         }
ERROR: (0)         783:         T*     data;      // data for the array

assert.zip

jpaver added a commit to jpaver/opengametools that referenced this issue Feb 5, 2023
- some vox files may have node names that exceed 65 bytes. Fixes vengi-voxel/vengi#226
- also added CHUNK_HEADER_LEN, NAME_MAX_LEN constants and fixed a few comments.
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

No branches or pull requests

1 participant