Fixed <rdar://problem/4127061> <canvas> backing store should be zero filled
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 May 2005 01:33:22 +0000 (01:33 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 May 2005 01:33:22 +0000 (01:33 +0000)
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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_canvasimage.cpp

index abeecb7c3d73f9fc75c41cc861407c9c73b285e8..4eaa8052e191083f96642bff524f3f148834511e 100644 (file)
@@ -1,3 +1,14 @@
+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.
index 8fb341005b526df88763080a0268077550f218f5..bac9dc4d4528b2b26577c9342e93c8a0bce94f48 100644 (file)
@@ -96,7 +96,7 @@ void RenderCanvasImage::createDrawingContext()
     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