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

Unified Diff: core/fxge/ge/fx_ge_text.cpp

Issue 2640143003: Update safe numerics package to get bitwise ops (Closed)
Patch Set: Address reviewer comments Created 3 years, 11 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 | « core/fxge/ge/cfx_renderdevice.cpp ('k') | third_party/agg23/agg_rasterizer_scanline_aa.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/ge/fx_ge_text.cpp
diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp
index ca88879d1087c2d4607e65cc29292f1b29fafe5c..cc7ef7c6d75ec019b54f5b7646638ed46af3bfa5 100644
--- a/core/fxge/ge/fx_ge_text.cpp
+++ b/core/fxge/ge/fx_ge_text.cpp
@@ -79,10 +79,14 @@ FX_RECT FXGE_GetGlyphsBBox(const std::vector<FXTEXT_GLYPHPOS>& glyphs,
continue;
if (bStarted) {
- rect.left = std::min(rect.left, char_left.ValueOrDie());
- rect.right = std::max(rect.right, char_right.ValueOrDie());
- rect.top = std::min(rect.top, char_top.ValueOrDie());
- rect.bottom = std::max(rect.bottom, char_bottom.ValueOrDie());
+ rect.left = pdfium::base::ValueOrDieForType<int32_t>(
+ pdfium::base::CheckMin(rect.left, char_left));
+ rect.right = pdfium::base::ValueOrDieForType<int32_t>(
+ pdfium::base::CheckMax(rect.right, char_right));
+ rect.top = pdfium::base::ValueOrDieForType<int32_t>(
+ pdfium::base::CheckMin(rect.top, char_top));
+ rect.bottom = pdfium::base::ValueOrDieForType<int32_t>(
+ pdfium::base::CheckMax(rect.bottom, char_bottom));
continue;
}
« no previous file with comments | « core/fxge/ge/cfx_renderdevice.cpp ('k') | third_party/agg23/agg_rasterizer_scanline_aa.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698