diff --git a/Cargo.lock b/Cargo.lock index a4afa9ef1..d3bd6391c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3037,8 +3037,8 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hwcodec" -version = "0.4.12" -source = "git+https://github.com/21pages/hwcodec#6fbafe7dd25adad5e897b3192b2b40b720a9b118" +version = "0.4.13" +source = "git+https://github.com/21pages/hwcodec#29f52366c274f55b74cca7e84fb33aa00f2b63a7" dependencies = [ "bindgen 0.59.2", "cc", diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 169635e1a..9f43f0c7b 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -1737,7 +1737,10 @@ class PredefinedCursor { _image?.dispose(); _image = await img.decodeImageFromPixels( data, defaultImg.width, defaultImg.height, ui.PixelFormat.rgba8888); - + if (_image == null) { + print("decodeImageFromPixels failed, pre-defined cursor $id"); + return; + } double scale = 1.0; if (isWindows) { data = _image2!.getBytes(order: img2.ChannelOrder.bgra); @@ -2104,7 +2107,7 @@ class CursorModel with ChangeNotifier { _x = -10000; _x = -10000; _image = null; - _images.clear(); + disposeImages(); _clearCache(); _cache = null;