From d30bd0ea268eb0effa680c20afb392d6576f9420 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 14 Sep 2017 11:17:36 +0200 Subject: [PATCH] src/driver/screenshot.cpp avoid memory ranges overlap --- src/driver/screenshot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/screenshot.cpp b/src/driver/screenshot.cpp index 1ad99fe01..28366adc2 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -393,7 +393,7 @@ bool CScreenShot::SaveJpg() int xres2 = xres1+2; for (int x = 0; x < xres; x++) { int x2 = x*3; - memcpy(pixel_data + x2 + xres1, pixel_data + x*4 + y*xres*4, 3); + memmove(pixel_data + x2 + xres1, pixel_data + x*4 + y*xres*4, 3); SWAP(pixel_data[x2 + xres1], pixel_data[x2 + xres2]); } }