Index: Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp |
=================================================================== |
--- Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp (revision 118409) |
+++ Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp (working copy) |
@@ -185,7 +185,12 @@ |
++srcUnpackAlignment; |
} |
- outputVector.resize(width * height * 4); |
+ unsigned int packedSize; |
+ // Output data is tightly packed (alignment == 1). |
+ if (computeImageSizeInBytes(format, type, width, height, 1, &packedSize, 0) != GraphicsContext3D::NO_ERROR) |
+ return false; |
+ outputVector.resize(packedSize); |
+ |
return packPixels(cairo_image_surface_get_data(imageSurface.get()), SourceFormatBGRA8, |
width, height, srcUnpackAlignment, format, type, alphaOp, outputVector.data()); |
} |