epezent / implot

Immediate Mode Plotting
MIT License
4.66k stars 520 forks source link

Uninitialized Pixels member leading to random infinite loop #313

Closed dpunset closed 2 years ago

dpunset commented 2 years ago

Hello,

The method ImPlot::BeginPlot was very rarely leading to an "infinite" loop, and I found that the reason was not having the member Pixels initialized in the constructor of ImPlotAxis like everything else. When calling SetAspect on the X Axis for the first time this was giving random results, sometimes giving a really large number.

I noticed that the code has changed, and Pixels doesn't exist anymore, but there is PixelMin and PixelMax, that don't seem to be initialized either. Since the code has changed a lot and I don't have the new version I can't verify if the issue still persists with the new implementation, but it's very likely it does, and it wouldn't harm to have those initialized to something.

epezent commented 2 years ago

3a53f0b

Thanks for the heads up. Let me know if this doesn't resolve the issue completey.