diff --git a/lib/sheenbidi/Source/SBParagraph.c b/lib/sheenbidi/Source/SBParagraph.c index 36d562cf8..f37d0aed1 100644 --- a/lib/sheenbidi/Source/SBParagraph.c +++ b/lib/sheenbidi/Source/SBParagraph.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "BidiChain.h" #include "BidiTypeLookup.h" @@ -54,6 +55,7 @@ static ParagraphContextRef CreateParagraphContext(const SBBidiType *types, SBLev const SBUInteger offsetTypes = offsetLinks + sizeLinks; SBUInt8 *memory = (SBUInt8 *)malloc(sizeMemory); + memset(memory, 0, sizeMemory); ParagraphContextRef context = (ParagraphContextRef)(memory + offsetContext); BidiLink *fixedLinks = (BidiLink *)(memory + offsetLinks); SBBidiType *fixedTypes = (SBBidiType *)(memory + offsetTypes);