do not crash if we are given a picture with invalid dimensions

This commit is contained in:
Michael Becker 2020-05-28 16:42:50 -04:00
parent 1947da62cd
commit f0bf09b709
No known key found for this signature in database
GPG Key ID: 506F54899E2BFED7

View File

@ -54,6 +54,7 @@ namespace UniversalEditor.Controls.DrawingArea
else
{
Console.WriteLine("new picture dimensions {0}x{1}", mvarPicture.Width, mvarPicture.Height);
if (mvarPicture.Width == 0 || mvarPicture.Height == 0) return;
Image image = mvarPicture.ToImage();
e.Graphics.DrawImage(image, 0, 0);