Index: third_party/woff2/src/woff2_dec.cc |
diff --git a/third_party/woff2/src/woff2_dec.cc b/third_party/woff2/src/woff2_dec.cc |
index 7a00f8a718425a19c506a6e95cf6b504f39b5188..6f26a305ffdab453e7dfe017f4957edb9d9e427d 100644 |
--- a/third_party/woff2/src/woff2_dec.cc |
+++ b/third_party/woff2/src/woff2_dec.cc |
@@ -18,6 +18,7 @@ |
#include <stdlib.h> |
#include <algorithm> |
+#include <brotli/decode.h> |
#include <complex> |
#include <cstring> |
#include <limits> |
@@ -27,7 +28,6 @@ |
#include <memory> |
#include <utility> |
-#include "./decode.h" |
#include "./buffer.h" |
#include "./port.h" |
#include "./round.h" |
@@ -736,9 +736,10 @@ bool ReconstructTransformedHmtx(const uint8_t* transformed_buf, |
bool Woff2Uncompress(uint8_t* dst_buf, size_t dst_size, |
const uint8_t* src_buf, size_t src_size) { |
size_t uncompressed_size = dst_size; |
- int ok = BrotliDecompressBuffer(src_size, src_buf, |
- &uncompressed_size, dst_buf); |
- if (PREDICT_FALSE(!ok || uncompressed_size != dst_size)) { |
+ BrotliDecoderResult result = BrotliDecoderDecompress( |
+ src_size, src_buf, &uncompressed_size, dst_buf); |
+ if (PREDICT_FALSE(result != BROTLI_DECODER_RESULT_SUCCESS || |
+ uncompressed_size != dst_size)) { |
return FONT_COMPRESSION_FAILURE(); |
} |
return true; |