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

Unified Diff: pdf/control.cc

Issue 519873002: Avoid OOB memcpy in chrome_pdf::CopyImage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename function for clarity. Created 6 years, 3 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 | pdf/draw_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/control.cc
diff --git a/pdf/control.cc b/pdf/control.cc
index 12bb7ed1689f872611f45124b139c33563d40891..ed911b6b95a521ae1793b94300dffb97a84054ca 100644
--- a/pdf/control.cc
+++ b/pdf/control.cc
@@ -53,7 +53,7 @@ void Control::PaintMultipleRects(pp::ImageData* image_data,
return;
pp::Rect draw_rc = pp::Rect(image_data->size()).Intersect(rect());
- pp::Rect ctrl_rc = pp::Rect(rect().point() - draw_rc.point(), draw_rc.size());
+ pp::Rect ctrl_rc = pp::Rect(draw_rc.point() - rect().point(), draw_rc.size());
CopyImage(*image_data, draw_rc, &buffer, ctrl_rc, false);
// Temporary move control to origin (0,0) and draw it into temp buffer.
« no previous file with comments | « no previous file | pdf/draw_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698