tsoding / musializer

Music Visualizer
MIT License
877 stars 92 forks source link

division by 0 on tooltips #75

Closed Markos-Th09 closed 7 months ago

Markos-Th09 commented 7 months ago

It is possible to end up with a difference value of 0 in the tooltip rendering code causing a division by zero. I have recorded a crash of dx being 0, causing a segfault.

    int dx = tooltip_boundary.x - diff.x;
    int dy = tooltip_boundary.y - diff.y;
    int dw = tooltip_boundary.width - diff.width;
    int dh = tooltip_boundary.height - diff.height;
    tooltip_boundary.x -= dx/abs(dx)*dw;
    tooltip_boundary.y -= dy/abs(dy)*dh;
Markos-Th09 commented 7 months ago

seems to be fixed after the last stream