Skip to content

Bug Fix: crash on importing invalid waterfall palette files#328

Merged
Chris-AC9KH merged 2 commits into
JS8Call-improved:masterfrom
Chris-AC9KH:pr/palette_crash
Jun 13, 2026
Merged

Bug Fix: crash on importing invalid waterfall palette files#328
Chris-AC9KH merged 2 commits into
JS8Call-improved:masterfrom
Chris-AC9KH:pr/palette_crash

Conversation

@Chris-AC9KH

Copy link
Copy Markdown
Collaborator
  • install guards on import_palette() and export_palette() functions to prevent std::terminate() → abort() if the file is invalid or contains too many colors
  • fix directory structure and move waterfall to JS8_UI

We had a classic uncaught exception in import_palette() that has evidently been there forever. So I put a guard on it. I found the same thing potentially exists in export_palette. It is unlikely that one would ever trigger but I put a wrapper on it anyway to be safe.

At the same time I moved the waterfall stuff to JS8_UI, which I evidently missed when I did the source code refactor a few months ago. It has a .ui file associated with it, so it belongs in JS8_UI

Fixes #326

prevent std::terminate() → abort() if the file is invalid or contains
too many colors
- fix directory structure and move waterfall to JS8_UI

@rruchte rruchte left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Joe-K0OG Joe-K0OG left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Linux and Windows, and works fine on both - no more crash, and a nice message indicating an incorrectly formatted .pal file. Thanks Chris!

73,
-Joe-
K0OG

@Chris-AC9KH Chris-AC9KH merged commit ab0d8a8 into JS8Call-improved:master Jun 13, 2026
4 checks passed
@Chris-AC9KH

Copy link
Copy Markdown
Collaborator Author

It also worked fine on MacOS, built locally here. It was an easily duplicatable issue so was able to get a local stack trace, which pinpointed the problem and made it easy to find.

@Chris-AC9KH Chris-AC9KH deleted the pr/palette_crash branch June 13, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

waterfall colorpalette import causes crashes

4 participants