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

Unified Diff: src/utils/win/SkDWriteFontFileStream.cpp

Issue 18503009: Fix SkTFits in to work properly with signed/unsigned mixtures. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Address comments by adding comments and assertions. Created 7 years, 5 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 | « src/utils/SkTLogic.h ('k') | tests/FitsInTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/win/SkDWriteFontFileStream.cpp
===================================================================
--- src/utils/win/SkDWriteFontFileStream.cpp (revision 9972)
+++ src/utils/win/SkDWriteFontFileStream.cpp (working copy)
@@ -9,10 +9,10 @@
#include "SkDWriteFontFileStream.h"
#include "SkHRESULT.h"
#include "SkTemplates.h"
+#include "SkTFitsIn.h"
#include "SkTScopedComPtr.h"
#include <dwrite.h>
-#include <limits>
///////////////////////////////////////////////////////////////////////////////
// SkIDWriteFontFileStream
@@ -183,7 +183,7 @@
return E_FAIL;
}
- if (fileOffset + fragmentSize > (std::numeric_limits<size_t>::max)()) {
+ if (!SkTFitsIn<size_t>(fileOffset + fragmentSize)) {
return E_FAIL;
}
« no previous file with comments | « src/utils/SkTLogic.h ('k') | tests/FitsInTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698