Page 1 of 1

Some brush library functions crash with palette brushes

Posted: Thu Mar 13, 2025 6:17 pm
by jPV
I haven't tried all similar functions, so it might affect to others too, but at least PerspectiveDistortBrush() and PolarDistortBrush() crash the whole Hollywood application if I use the "smooth" option with palette based images. Functions do work fine if that option isn't enabled.

I've tested it on MorphOS and there's a big hit in the debug log and the application window meditates.

Code: Select all

CreateBrush(1, 640, 480, #BLUE, {Palette=#PALETTE_AGA})
NPrint("Perspective no smoothing")
PerspectiveDistortBrush(1, 100, 0, 400, 0, 500, 300, 0, 300, False) ; Doesn't crash
WaitLeftMouse()
CreateBrush(1, 640, 480, #BLUE, {Palette=#PALETTE_AGA})
NPrint("Perspective smoothing")
PerspectiveDistortBrush(1, 100, 0, 400, 0, 500, 300, 0, 300, True)  ; Crashes

CreateBrush(1, 640, 480, #BLUE, {Palette=#PALETTE_AGA})
NPrint("Polar no smoothing")
PolarDistortBrush(1, 320, 0, 320, 240, -180, 180, False) ; Doesn't crash
WaitLeftMouse()
NPrint("Polar smoothing")
PolarDistortBrush(1, 320, 0, 320, 240, -180, 180, True) ; Crashes

Re: Some brush library functions crash with palette brushes

Posted: Fri Mar 14, 2025 6:12 pm
by airsoftsoftwair
Hmm, with Hollywood 10.0 only PolarDistortBrush() crashes here, with the latest Hollywood master I don't get any crashes at all so it might have been fixed already but I'm not sure. I'll check.

Re: Some brush library functions crash with palette brushes

Posted: Sun May 04, 2025 5:32 pm
by airsoftsoftwair
Actually, memory got trashed here which is why I couldn't reproduce it first. But it's fixed now.

Code: Select all

- Fix: PerspectiveDistortBrush(), ArcDistortBrush(), PolarDistortBrush() and BarrelDistortBrush() trashed
  memory when used with a palette brush and the "smooth" argument was set to TRUE; the smooth argument is
  ignored now for palette brushes which is the same behaviour that other functions like ScaleBrush() and
  RotateBrush() use because antialias interpolation is only supported for RGB brushes