From: Hosang Kim Date: Mon, 11 Dec 2023 02:20:27 +0000 (+0900) Subject: TakeScreenshot: fix screenshot image buffer size. X-Git-Tag: accepted/tizen/8.0/unified/20240201.164548~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05a3270efc721f1641f51767d4140009955d9559;p=platform%2Fcore%2Fuifw%2Faurum.git 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 --- 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()) {