Fix: Avoid a 0 size malloc when there are no entry to copy in current selection

This commit is contained in:
mathieu _alkama_ m 2015-12-13 13:09:03 +01:00
parent ccf278d144
commit ec2528db54

View File

@ -577,6 +577,8 @@ static void copySelection(int row, int track, int selectLeft, int selectRight, i
}
free(s_copyData.entries);
if (copy_count != 0)
{
entry = s_copyData.entries = malloc(sizeof(CopyEntry) * copy_count);
for (track = selectLeft; track <= selectRight; ++track)
@ -594,6 +596,7 @@ static void copySelection(int row, int track, int selectLeft, int selectRight, i
entry++;
}
}
}
s_copyData.bufferWidth = selectRight - selectLeft + 1;
s_copyData.bufferHeight = selectBottom - selectTop + 1;