On Mon Jul 31 15:59:36 2023 +0000, Fabian Maurer wrote:
Thanks for the ping, I wasn't even aware of the issue. I did some testing, and the real critical part is the second part of the test:
/* path seen in the wild that caused a stack overflow */ /* same path but redo with the manual points that caused a crash */ status = GdipResetPath(path); expect(Ok, status); status = GdipAddPathBezier(path, 154.950806, 33.391144, 221.586075, 15.536285, 291.747314, 15.536285, 358.382568, 33.391144); expect(Ok, status); status = GdipAddPathBezier(path, 256.666809, 412.999512, 256.666718, 412.999481, 256.666656, 412.999481, 256.666565, 412.999512); expect(Ok, status); status = GdipClosePathFigure(path); expect(Ok, status); status = GdipFlattenPath(path, NULL, 1.0);
The first part of the flatten2 test was just a duplicate test for the same issue, it could be removed as well. Since it doesn't work on windows (sorry for that btw) I think that would be the better idea.
It looks to me like the original tests are just trying to pass in the smallest rectangle possible. I used `1.0` for the width and height since that is the default pen width.