mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-11 18:50:30 +00:00
GUI: Crash fix
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4095 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
ff962750fb
commit
78bd8c874a
1 changed files with 6 additions and 3 deletions
|
@ -130,7 +130,8 @@ void ConsoleListener::LetterSpace(int Width, int Height)
|
||||||
void ConsoleListener::PixelSpace(int Left, int Top, int Width, int Height, bool Resize)
|
void ConsoleListener::PixelSpace(int Left, int Top, int Width, int Height, bool Resize)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
// Check size
|
||||||
|
if (Width < 8 || Height < 12) return;
|
||||||
|
|
||||||
// Get console info
|
// Get console info
|
||||||
CONSOLE_SCREEN_BUFFER_INFO ConInfo;
|
CONSOLE_SCREEN_BUFFER_INFO ConInfo;
|
||||||
|
@ -140,9 +141,11 @@ void ConsoleListener::PixelSpace(int Left, int Top, int Width, int Height, bool
|
||||||
int LHeight = floor((float)(Height / 12));
|
int LHeight = floor((float)(Height / 12));
|
||||||
int LBufHeight = floor((float)(MAX_BYTES / (LWidth + 1)));
|
int LBufHeight = floor((float)(MAX_BYTES / (LWidth + 1)));
|
||||||
|
|
||||||
|
// Check size
|
||||||
|
DWORD dwConSize = ConInfo.dwSize.X * ConInfo.dwSize.Y;
|
||||||
|
if (dwConSize > MAX_BYTES) return;
|
||||||
// Read the current text
|
// Read the current text
|
||||||
char Str[MAX_BYTES];
|
char Str[MAX_BYTES];
|
||||||
DWORD dwConSize = ConInfo.dwSize.X * ConInfo.dwSize.Y;
|
|
||||||
DWORD cCharsRead = 0;
|
DWORD cCharsRead = 0;
|
||||||
COORD coordScreen = { 0, 0 };
|
COORD coordScreen = { 0, 0 };
|
||||||
ReadConsoleOutputCharacter(hConsole, Str, dwConSize, coordScreen, &cCharsRead);
|
ReadConsoleOutputCharacter(hConsole, Str, dwConSize, coordScreen, &cCharsRead);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue