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

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

Issue 15941025: Add SkData::NewFromFD. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Remove an indentation level. Created 7 years, 7 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/ports/SkOSFile_win.cpp ('k') | tests/DataRefTest.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 9384)
+++ src/utils/win/SkDWriteFontFileStream.cpp (working copy)
@@ -8,6 +8,7 @@
#include "SkTypes.h"
#include "SkDWriteFontFileStream.h"
#include "SkHRESULT.h"
+#include "SkTemplates.h"
#include "SkTScopedComPtr.h"
#include <dwrite.h>
@@ -111,7 +112,7 @@
HRESULT hr = S_OK;
UINT64 realFileSize = 0;
hr = fFontFileStream->GetFileSize(&realFileSize);
- if (realFileSize > (std::numeric_limits<size_t>::max)()) {
+ if (!SkTFitsIn<size_t>(realFileSize)) {
return 0;
}
return static_cast<size_t>(realFileSize);
« no previous file with comments | « src/ports/SkOSFile_win.cpp ('k') | tests/DataRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698