Skip to content

Commit

Permalink
Merge pull request #284 from Jackyjjc/main
Browse files Browse the repository at this point in the history
Set correct max_size for woff2 decompress output buffer
  • Loading branch information
khaledhosny authored Sep 26, 2024
2 parents 66c08e0 + 4baccb3 commit cf38b5d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ots.cc
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ bool ProcessWOFF2(ots::FontFile *header,

std::string buf(decompressed_size, 0);
woff2::WOFF2StringOut out(&buf);
out.SetMaxSize(decompressed_size);
if (!woff2::ConvertWOFF2ToTTF(data, length, &out)) {
return OTS_FAILURE_MSG_HDR("Failed to convert WOFF 2.0 font to SFNT");
}
Expand Down

0 comments on commit cf38b5d

Please sign in to comment.