https://bugs.winehq.org/show_bug.cgi?id=57306
--- Comment #12 from Rafał Mużyło galtgendo@o2.pl --- The way I see it, generate_ellipse_top_half is just badly commented - it seem to make some implicit assumptions about its inputs, but doesn't seem to state those assumptions anywhere.
The algorithm is likely correct is all but 'points[pos++] = pt;' line, that is it never states what size it expects that array to be - well, the original algorithm likely just drawn a point at that point, instead of storing it.