From d19d4aacdbba337561e920f5fd6fdab8da909446 Mon Sep 17 00:00:00 2001 From: fufesou Date: Thu, 9 Mar 2023 19:38:47 +0800 Subject: [PATCH] avoid invalid texture width and height Signed-off-by: fufesou --- flutter/lib/models/model.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 802a18a52..a8ed56bc5 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -371,7 +371,11 @@ class FfiModel with ChangeNotifier { _updateSessionWidthHeight(String id) { parent.target?.canvasModel.updateViewStyle(); - bind.sessionSetSize(id: id, width: display.width, height: display.height); + if (display.width < 0 || display.height < 0) { + debugPrintStack(label: 'invalid display size (${display.width},${display.height})'); + } else { + bind.sessionSetSize(id: id, width: display.width, height: display.height); + } } /// Handle the peer info event based on [evt].