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

Unified Diff: webkit/plugins/ppapi/ppb_image_data_impl.cc

Issue 11416296: Merge 167882 - Security fix: integer overflow on checking image size (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 8 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_image_data_impl.cc
===================================================================
--- webkit/plugins/ppapi/ppb_image_data_impl.cc (revision 170569)
+++ webkit/plugins/ppapi/ppb_image_data_impl.cc (working copy)
@@ -54,8 +54,8 @@
return false; // Only support this one format for now.
if (width <= 0 || height <= 0)
return false;
- if (static_cast<int64>(width) * static_cast<int64>(height) * 4 >=
- std::numeric_limits<int32>::max())
+ if (static_cast<int64>(width) * static_cast<int64>(height) >=
+ std::numeric_limits<int32>::max() / 4)
return false; // Prevent overflow of signed 32-bit ints.
format_ = format;
@@ -285,4 +285,3 @@
} // namespace ppapi
} // namespace webkit
-
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698