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

Unified Diff: printing/image.cc

Issue 11953003: Make printing build on Win64 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 | « no previous file | printing/pdf_metafile_skia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/image.cc
===================================================================
--- printing/image.cc (revision 177853)
+++ printing/image.cc (working copy)
@@ -8,6 +8,7 @@
#include "base/file_util.h"
#include "base/md5.h"
+#include "base/safe_numerics.h"
#include "base/string_number_conversions.h"
#include "printing/metafile.h"
#include "printing/metafile_impl.h"
@@ -71,7 +72,8 @@
if (success) {
int write_bytes = file_util::WriteFile(
filepath,
- reinterpret_cast<char*>(&*compressed.begin()), compressed.size());
+ reinterpret_cast<char*>(&*compressed.begin()),
+ base::checked_numeric_cast<int>(compressed.size()));
success = (write_bytes == static_cast<int>(compressed.size()));
DCHECK(success);
}
@@ -149,7 +151,8 @@
bool Image::LoadMetafile(const std::string& data) {
DCHECK(!data.empty());
NativeMetafile metafile;
- if (!metafile.InitFromData(data.data(), data.size()))
+ if (!metafile.InitFromData(data.data(),
+ base::checked_numeric_cast<uint32>(data.size())))
return false;
return LoadMetafile(metafile);
}
« no previous file with comments | « no previous file | printing/pdf_metafile_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698