Skip to content

Random crash on Windows when using hb_blob_get_data #4669

Closed Answered by jfkthame
liZe asked this question in Q&A
Discussion options

You must be logged in to vote

The length you're passing to hb_blob_get_data needs to be a pointer to an unsigned int where the function can store a result, but AFAICS you're passing an uninitialized pointer, so who knows what may happen when harfbuzz tries to store a value there. If it sometimes works on some platforms, well ... welcome to "undefined behavior".

Make length an unsigned int (not an unsigned int *), and then pass its address (&length) to hb_blob_get_data.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by khaledhosny
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4668 on April 18, 2024 15:34.