diff --git a/src/CanvasRenderingContext2d.cc b/src/CanvasRenderingContext2d.cc index 3c85c0e..2343049 100644 --- a/src/CanvasRenderingContext2d.cc +++ b/src/CanvasRenderingContext2d.cc @@ -329,7 +329,6 @@ Context2d::blur(cairo_surface_t *surface, int radius) { // get width, height int width = cairo_image_surface_get_width( surface ); int height = cairo_image_surface_get_height( surface ); - unsigned char* dst = (unsigned char*)malloc(width*height*4); unsigned* precalc = (unsigned*)malloc(width*height*sizeof(unsigned)); unsigned char* src = cairo_image_surface_get_data( surface ); @@ -341,8 +340,6 @@ Context2d::blur(cairo_surface_t *surface, int radius) { const int MAX_ITERATIONS = 3; int iteration; - memcpy( dst, src, width*height*4 ); - for ( iteration = 0; iteration < MAX_ITERATIONS; iteration++ ) { for( channel = 0; channel < 4; channel++ ) { int x,y; @@ -364,7 +361,7 @@ Context2d::blur(cairo_surface_t *surface, int radius) { } // blur step. - pix = dst + (int)radius * width * 4 + (int)radius * 4 + channel; + pix = src + (int)radius * width * 4 + (int)radius * 4 + channel; for (y=radius;y