From 74e1e85eb207981fc464beabfc0b25dbdd4c18bc Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Mon, 11 Dec 2023 11:20:27 +0900 Subject: [PATCH] TakeScreenshot: fix screenshot image buffer size. The reason for multiplying by 4 is that image is a 32-bit RGBA PNG file. So it is maximum image file size. Change-Id: I0396310cd104d5e1786c11fd9816a47548858abf --- org.tizen.aurum-bootstrap/src/Commands/TakeScreenshotCommand.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.tizen.aurum-bootstrap/src/Commands/TakeScreenshotCommand.cc b/org.tizen.aurum-bootstrap/src/Commands/TakeScreenshotCommand.cc index 73f84e5..fe12fbb 100644 --- a/org.tizen.aurum-bootstrap/src/Commands/TakeScreenshotCommand.cc +++ b/org.tizen.aurum-bootstrap/src/Commands/TakeScreenshotCommand.cc @@ -51,7 +51,7 @@ TakeScreenshotCommand::TakeScreenshotCommand( std::ifstream ifs(path, std::ifstream::binary); ::aurum::RspTakeScreenshot rsp; const Size2D screenSize = mDevice->getScreenSize(); - int size = screenSize.width * screenSize.height; + int size = screenSize.width * screenSize.height * 4; //The reason for multiplying by 4 is that image is a 32-bit RGBA PNG file. char *buf = new char[size]; while (!ifs.eof()) { -- 2.34.1