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

Unified Diff: ui/gfx/codec/png_codec.cc

Issue 12313139: captureVisibleTab Extension API producing garbled PNG results (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Unit test updates no 2 Created 7 years, 10 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
Index: ui/gfx/codec/png_codec.cc
diff --git a/ui/gfx/codec/png_codec.cc b/ui/gfx/codec/png_codec.cc
index 1b8b5c77d910d20d7babcd12f4518e56172439a5..4e1320738d00807dfb596f0bdbe7dc30f33ce8d2 100644
--- a/ui/gfx/codec/png_codec.cc
+++ b/ui/gfx/codec/png_codec.cc
@@ -768,10 +768,11 @@ bool PNGCodec::EncodeBGRASkBitmap(const SkBitmap& input,
if (input.empty())
return false;
DCHECK(input.bytesPerPixel() == bbp);
+ DCHECK(input.rowBytes() >= input.width() * bbp);
return Encode(reinterpret_cast<unsigned char*>(input.getAddr32(0, 0)),
FORMAT_SkBitmap, Size(input.width(), input.height()),
- input.width() * bbp, discard_transparency,
+ input.rowBytes(), discard_transparency,
std::vector<Comment>(), output);
}
« no previous file with comments | « AUTHORS ('k') | ui/gfx/codec/png_codec_unittest.cc » ('j') | ui/gfx/codec/png_codec_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698