From 4baccb3654247697bca38e5283321c5e2f79a365 Mon Sep 17 00:00:00 2001 From: Jacky Chen Date: Thu, 26 Sep 2024 17:43:44 +1000 Subject: [PATCH] Set correct max_size for woff2 decompress output buffer --- src/ots.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ots.cc b/src/ots.cc index ed22b8cc..8424e02f 100644 --- a/src/ots.cc +++ b/src/ots.cc @@ -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"); }