Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: third_party/woff2/src/woff2_dec.cc

Issue 1895043002: WOFF2: avoid a Msan error use-of-uninitialized-value in woff2_dec.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update (address upstream review comments) Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/woff2/README.chromium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 837eede131807f51dd7ae2e131b06fc4ec7a5761..ea1f1693bc5198507bfc5fa0ed89eb550d08f6b8 100644
--- a/third_party/woff2/src/woff2_dec.cc
+++ b/third_party/woff2/src/woff2_dec.cc
@@ -603,13 +603,12 @@ bool ReconstructGlyf(const uint8_t* data, Table* glyf_table,
*glyf_checksum += ComputeULongSum(glyph_buf.get(), glyph_size);
// We may need x_min to reconstruct 'hmtx'
- Buffer x_min_buf(glyph_buf.get() + 2, 2);
- int16_t x_min;
- if (PREDICT_FALSE(!x_min_buf.ReadS16(&x_min))) {
- return FONT_COMPRESSION_FAILURE();
+ if (n_contours > 0) {
+ Buffer x_min_buf(glyph_buf.get() + 2, 2);
+ if (PREDICT_FALSE(!x_min_buf.ReadS16(&info->x_mins[i]))) {
+ return FONT_COMPRESSION_FAILURE();
+ }
}
-
- info->x_mins[i] = n_contours != 0 ? x_min : 0;
}
// glyf_table dst_offset was set by ReconstructFont
« no previous file with comments | « third_party/woff2/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698