Skip to content

Commit

Permalink
Set correct max_size for woff2 decompress output buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackyjjc committed Sep 26, 2024
1 parent 66c08e0 commit 4baccb3
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 4baccb3

Please sign in to comment.