diff --git a/src/graphics/Graphics.cpp b/src/graphics/Graphics.cpp index f8519655b..068cc5d3d 100644 --- a/src/graphics/Graphics.cpp +++ b/src/graphics/Graphics.cpp @@ -413,13 +413,13 @@ pixel *Graphics::resample_img(pixel *src, int sw, int sh, int rw, int rh) pixel *q = NULL; if(rw == sw && rh == sh){ //Don't resample - q = (pixel *)malloc(rw*rh*PIXELSIZE); - memcpy(q, src, rw*rh*PIXELSIZE); + q = new pixel[rw*rh]; + std::copy(src, src+(rw*rh), q); } else if(!stairstep) { float fx, fy, fyc, fxc; double intp; pixel tr, tl, br, bl; - q = (pixel *)malloc(rw*rh*PIXELSIZE); + q = new pixel[rw*rh]; //Bilinear interpolation for upscaling for (y=0; y