From 41b7873147ceaceefa95b83b738f1d8eb6fd35e5 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 15 Mar 2017 19:02:44 +0100 Subject: [PATCH] screenshot.cpp fix memcpy param overlap Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/142ac1392f87a70c74d6b8a50e34f59755a3f292 Author: Jacek Jendrzej Date: 2017-03-15 (Wed, 15 Mar 2017) --- 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 98b873ca0..db6bf89d7 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -268,7 +268,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]); } }