Skip to content

Comments

Fix incorrect allocation of cd_values array in get_dataset_filters()#117

Merged
bmaranville merged 1 commit intomainfrom
fix-malloc-cd-values
Jan 6, 2026
Merged

Fix incorrect allocation of cd_values array in get_dataset_filters()#117
bmaranville merged 1 commit intomainfrom
fix-malloc-cd-values

Conversation

@bmaranville
Copy link
Member

For filters that use more than 16 elements in cd_values, the current allocation call only allocates nelements bytes, but cd_values is array of unsigned int - need to allocate nelements * sizeof(unsigned int)

Somehow this didn't throw an error before in tests (malloc sometimes allocates more than requested?) but with emcc version 4.0.22 it throws an error when running the filters_test.

@bmaranville bmaranville merged commit a92f90e into main Jan 6, 2026
2 checks passed
@bmaranville bmaranville deleted the fix-malloc-cd-values branch January 6, 2026 16:51
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.

1 participant