Chromium Code Reviews| Index: ui/gl/gl_image_memory.cc |
| diff --git a/ui/gl/gl_image_memory.cc b/ui/gl/gl_image_memory.cc |
| index 0a67e000665b6a5806a0f935f61e02faaf540a15..ef62d4c1d62be4f9a5c69881830f0a43be9c5d30 100644 |
| --- a/ui/gl/gl_image_memory.cc |
| +++ b/ui/gl/gl_image_memory.cc |
| @@ -100,11 +100,12 @@ GLImageMemory::~GLImageMemory() { |
| } |
| // static |
| -size_t GLImageMemory::BytesPerPixel(gfx::GpuMemoryBuffer::Format format) { |
| +size_t GLImageMemory::StrideInBytes( |
| + size_t width, gfx::GpuMemoryBuffer::Format format) { |
| switch (format) { |
| case gfx::GpuMemoryBuffer::RGBA_8888: |
| case gfx::GpuMemoryBuffer::BGRA_8888: |
| - return 4; |
| + return width * 4; |
|
reveman
2014/12/18 18:49:57
Can this overflow? Should it be using CheckedNumer
christiank
2015/01/12 10:35:23
Yes, think it can. It's now updated to use Checked
|
| case gfx::GpuMemoryBuffer::RGBX_8888: |
| NOTREACHED(); |
| return 0; |