Use calloc instead of malloc to ensure zero filled backing store.
Reviewed by Darin.
* khtml/rendering/render_canvasimage.cpp:
(RenderCanvasImage::createDrawingContext):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9213
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-05-24 Richard Williamson <rjw@apple.com>
+
+ Fixed <rdar://problem/4127061> <canvas> backing store should be zero filled
+
+ Use calloc instead of malloc to ensure zero filled backing store.
+
+ Reviewed by Darin.
+
+ * khtml/rendering/render_canvasimage.cpp:
+ (RenderCanvasImage::createDrawingContext):
+
2005-05-24 John Sullivan <sullivan@apple.com>
Reviewed by Dave Hyatt.
int cHeight = contentHeight();
size_t numComponents = CGColorSpaceGetNumberOfComponents(colorSpace);
size_t bytesPerRow = BYTES_PER_ROW(cWidth,BITS_PER_COMPONENT,(numComponents+1)); // + 1 for alpha
- _drawingContextData = malloc(height() * bytesPerRow);
+ _drawingContextData = calloc(height(), bytesPerRow);
_drawingContext = CGBitmapContextCreate(_drawingContextData, cWidth, cHeight, BITS_PER_COMPONENT, bytesPerRow, colorSpace, kCGImageAlphaPremultipliedLast);
#ifdef DEBUG_CANVAS_BACKGROUND