Nikolay Sivov (@nsivov) commented about dlls/dwrite/bidi.c:
open_stack = malloc(sizeof(WCHAR) * iso_run->length); stack_index = malloc(sizeof(int) * iso_run->length); + out = malloc(sizeof(BracketPair) * iso_run->length);
- for (i = 0; i < iso_run->length; i++) { - unsigned short ubv = get_table_entry_16(bidi_bracket_table, iso_run->item[i].ch); - if (ubv) - { - if (!out) - { - out = malloc(sizeof(BracketPair)); - out[0].start = -1; - } + if (open_stack && stack_index && out) { + out[0].start = -1;
No need to change that much. You can check all 3 allocations at once, and return on failure. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1778#note_19676