return zero-byte array instead of crashing if there is no bitmap data

This commit is contained in:
Michael Becker 2022-10-02 00:46:43 -04:00
parent 8496fd116c
commit d5cc7a716f
No known key found for this signature in database
GPG Key ID: DA394832305DA332

View File

@ -227,9 +227,14 @@ namespace UniversalEditor.ObjectModels.Multimedia.Picture
DataRequestEventArgs e = new DataRequestEventArgs();
OnDataRequest(e);
}
if (bitmapData.Length == 0)
{
return new byte[0];
}
// memory goes from left to right, top to bottom
byte[] data = new byte[mvarWidth * mvarHeight * 4];
int i = 0;
for (int h = 0; h < mvarHeight; h++)
{