Applying Mask Crash

Am I doing something wrong here but as a test:

dim p,p1 as Picture
dim mask as new Picture(32,32)

p = BitmapForCaching(32,32)
p1 = new Picture(32,32)

p1.ApplyMask(mask)
p.ApplyMask(mask)

Crashes out the app when applying the mask to p.
I cannot see a difference between p1 and p.

Also if the mask comes from a Xojo_Image (immutable) it always crashes

so

dim p,p1 as Picture
dim mask as new Picture(48,48)
dim mask1 as Picture = Control_Help

p = BitmapForCaching(48,48)
p1 = new Picture(48,48)

p1.ApplyMask(mask)
p1.ApplyMask(mask1)


p.ApplyMask(mask)
p.ApplyMask(mask1)

Crashes on p1.ApplyMask(mask1)

Built error shown is

Location: Common/MacOS/DrawableCocoa.cpp:396
Condition: drawableMask->Type() == kDrawableCocoa

Then

Location: Common/MacOS/DrawableCocoa.cpp:399
Condition: IsValidMask(mask)

Cloning the Xojo_Image to a mutable image allows it to be applied

Running on macOS 10.14.6 Xojo 2020r2 on a 1X scaled screen

Please fill a feedback case, so Xojo engineers can check it.

Workaround may be to clone mask1 to be a bitmap picture, too.

The workaround is to not use bitmap for caching and scale the width and height yourself AND, as you say, clone the mask after getting the best representation out of it.

p = new Picture(48 * me.ScaleFactor,48 * me.ScaleFactor)
mask = Control_Help.BestRepresentation(p.Width,p.Height,me.ScaleFactor).CloneMBS()
p.ApplyMask(mask)