Index: Source/platform/image-encoders/skia/WEBPImageEncoder.cpp |
diff --git a/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp b/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp |
index 3f00f6797e6132f1ceeb86dd3574aac64f9b9cf1..e82e4bffa23940a81d8f68219ebb6a53e62eb6e9 100644 |
--- a/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp |
+++ b/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp |
@@ -53,9 +53,8 @@ static bool rgbPictureImport(const unsigned char* pixels, bool premultiplied, We |
// Write the RGB pixels to an rgb data buffer, alpha premultiplied, then import the rgb data. |
- Vector<unsigned char> rgb; |
size_t pixelCount = picture->height * picture->width; |
- rgb.reserveInitialCapacity(pixelCount * 3); |
+ Vector<unsigned char> rgb(pixelCount * 3); |
Noel Gordon
2015/07/21 00:48:36
Overall patch seems fine, but just to confirm, the
|
for (unsigned char* data = rgb.data(); pixelCount-- > 0; pixels += 4) { |
unsigned char alpha = pixels[3]; |