| 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);
|
| }
|
|
|
|
|