From 05a3f82a5c385e7f00aa2bb8c1971e1cc99225a3 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:27:13 +0100 Subject: Fix "Setting window custom cursor from SVG image crashes" (#1363) --- src/Fl_cocoa.mm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Fl_cocoa.mm') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 66d5227fd..7f12390d2 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -4161,6 +4161,11 @@ int Fl_Cocoa_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int if ((hoty < 0) || (hoty >= image->h())) return 0; + if (image->as_svg_image()) { + Fl_RGB_Image *image2 = (Fl_RGB_Image*)image->copy(); + image2->normalize(); + image = image2; + } // OS X >= 10.6 can create a NSImage from a CGImage, but we need to // support older versions, hence this pesky handling. @@ -4220,6 +4225,7 @@ int Fl_Cocoa_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int [bitmap release]; [nsimage release]; + if (image->as_svg_image()) delete image; return 1; } -- cgit v1.2.3