Index: content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc |
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc b/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc |
index 401d37a39cd082097e0b84abc818e8dd54608c7c..c6c47289e7d72ba40559ca6fb5c50105251965dd 100644 |
--- a/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc |
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc |
@@ -75,8 +75,12 @@ void* GpuMemoryBufferImplSurfaceTexture::Map() { |
return NULL; |
} |
+ size_t stride_in_bytes = 0; |
+ if (!StrideInBytes(buffer.stride, format_, &stride_in_bytes)) |
+ return NULL; |
+ |
DCHECK_LE(size_.width(), buffer.stride); |
- stride_ = buffer.stride * BytesPerPixel(format_); |
+ stride_ = stride_in_bytes; |
mapped_ = true; |
return buffer.bits; |
} |