Fix: Avoid a 0 size malloc when there are no entry to copy in current selection
This commit is contained in:
parent
ccf278d144
commit
ec2528db54
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user