mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-04 22:31:02 +00:00
libpng reports a bad file by longjmp()ing back to the buffer set with setjmp(), and the frame it lands in must own nothing that needs destroying: with exceptions enabled MSVC unwinds the stack as part of longjmp, and returning from a frame unwound that way crashes. It did on Windows while working everywhere else. The read callback also returned quietly on a short read, leaving libpng to decode whatever happened to be in the output buffer. The calls that can fail now sit in two helpers that own nothing but pointers, so every C++ object the decoders need stays in their own frames, and a short read is reported through png_error().
OrcaSlicer tests
Building, running and writing tests is documented on the wiki, under How to Test.
Two files here rather than there, because coding agents only read what is in the repository: