Commit 4a5cea7c authored by Libor Tomsik's avatar Libor Tomsik Committed by David Schulz

BinEditor: Showing error when opening file bigger than 2GB

Adding check if binary file is bigger than 2GB (MAX_INT)
and then reporting an error message instead of leaving
editor content empty.

Task-number: QTCREATORBUG-10149
Change-Id: I96f70631f11f59199e5acde4cad57a0b0efa12af
Reviewed-by: default avatarRobert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent a65d0f88
......@@ -278,6 +278,14 @@ public:
QMessageBox::critical(ICore::mainWindow(), tr("File Error"), msg);
return false;
}
if (size > INT_MAX) {
QString msg = tr("The file is too big for the Binary Editor (max. 2GB).");
if (errorString)
*errorString = msg;
else
QMessageBox::critical(ICore::mainWindow(), tr("File Error"), msg);
return false;
}
if (offset >= size)
return false;
setFilePath(FileName::fromString(fileName));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment