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

Unified Diff: pdf/draw_utils.cc

Issue 465133005: pdf: Early out from CopyImage if there's nothing to copy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/draw_utils.cc
diff --git a/pdf/draw_utils.cc b/pdf/draw_utils.cc
index 0976de9f78e920c12af671e3d8ba921a3dac275f..8bc3ac3ae1e6b12c9ceac5a0079980f7d363aef3 100644
--- a/pdf/draw_utils.cc
+++ b/pdf/draw_utils.cc
@@ -146,7 +146,9 @@ void CopyImage(const pp::ImageData& src, const pp::Rect& src_rc,
pp::ImageData* dest, const pp::Rect& dest_rc,
bool stretch) {
DCHECK(src_rc.width() <= dest_rc.width() &&
- src_rc.height() <= dest_rc.height());
+ src_rc.height() <= dest_rc.height());
+ if (src_rc.IsEmpty())
+ return;
const uint32_t* src_origin_pixel = src.GetAddr32(src_rc.point());
uint32_t* dest_origin_pixel = dest->GetAddr32(dest_rc.point());
« 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