mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-24 19:45:07 +00:00
SAGA2: Fix save game dialog crash
This commit is contained in:
parent
b9e04f912e
commit
067fcb00d7
@ -181,7 +181,7 @@ gTextBox::gTextBox(
|
||||
flags = flg;
|
||||
currentLen[index] = buffer ? strlen(buffer) : 0;
|
||||
cursorPos = anchorPos = scrollPixels = 0;
|
||||
undoBuffer = (char *)malloc(sizeof(char) * (maxLen + 1));
|
||||
undoBuffer = new char[maxLen + 1]();
|
||||
textFont = font;
|
||||
fontHeight = height;
|
||||
fontOffset = fontHeight + 2;
|
||||
@ -233,7 +233,7 @@ gTextBox::~gTextBox() {
|
||||
deSelect();
|
||||
selected = 0;
|
||||
if (undoBuffer) {
|
||||
delete undoBuffer;
|
||||
delete[] undoBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -593,11 +593,12 @@ void destroyFileFields(char **strings) {
|
||||
uint16 i;
|
||||
|
||||
for (i = 0; i < numEditLines; i++) {
|
||||
if (strings[i]) delete strings[i];
|
||||
strings[i] = NULL;
|
||||
if (strings[i])
|
||||
delete[] strings[i];
|
||||
strings[i] = nullptr;
|
||||
}
|
||||
|
||||
delete strings;
|
||||
delete[] strings;
|
||||
}
|
||||
|
||||
bool getSaveName(int8 saveNo, SaveFileHeader &header) {
|
||||
|
@ -66,7 +66,8 @@ void gDisplayPort::bltPixels(
|
||||
sect;
|
||||
uint8 *src_line;
|
||||
|
||||
clip = Rect16(0, 0, map->size.x, map->size.y);
|
||||
if (clip.empty())
|
||||
clip = Rect16(0, 0, map->size.x, map->size.y);
|
||||
sect = intersect(clip, r);
|
||||
|
||||
if (!sect.empty()) { // if result is non-empty
|
||||
|
Loading…
x
Reference in New Issue
Block a user