Skip to content

Commit

Permalink
Initialize memory of bidi chain
Browse files Browse the repository at this point in the history
This fixes an error of reading uninitialized memory, as reported by
Valgrind.

Fixes #19.
  • Loading branch information
InfoTeddy committed Jan 10, 2024
1 parent e667eb3 commit 3469076
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/SBParagraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ static ParagraphContextRef CreateParagraphContext(const SBBidiType *types, SBLev
SBBidiType *fixedTypes = (SBBidiType *)(memory + offsetTypes);

BidiChainInitialize(&context->bidiChain, fixedTypes, levels, fixedLinks);
for (SBUInteger i = 0; i < length + 2; ++i) {
fixedTypes[i] = SBBidiTypeNil;
}
StatusStackInitialize(&context->statusStack);
RunQueueInitialize(&context->runQueue);
IsolatingRunInitialize(&context->isolatingRun);
Expand Down

0 comments on commit 3469076

Please sign in to comment.