prevent invalid size instructions since apparently that can happen

This commit is contained in:
Elijah R 2024-06-02 13:11:16 -04:00
parent acdbdc7e73
commit 7f0dc17590

View file

@ -292,6 +292,7 @@ public class CollabVMClient {
if (msgArr[1] != "0") return; if (msgArr[1] != "0") return;
var width = int.Parse(msgArr[2]); var width = int.Parse(msgArr[2]);
var height = int.Parse(msgArr[3]); var height = int.Parse(msgArr[3]);
if (width == 0 || height == 0) return;
this.framebuffer = new Image<Rgba32>(width, height); this.framebuffer = new Image<Rgba32>(width, height);
this.ScreenSize.Invoke(this, new ScreenSizeEventArgs { Width = width, Height = height }); this.ScreenSize.Invoke(this, new ScreenSizeEventArgs { Width = width, Height = height });
break; break;