mainui_cpp icon indicating copy to clipboard operation
mainui_cpp copied to clipboard

UI_DrawString can get stuck until integer overflow if bounds are too small

Open noodlecollie opened this issue 6 years ago • 1 comments

I noticed after neglecting to set a size for a table view that the menu would take up to 10 seconds to render a single frame. After some investigation I worked out that it was UI_DrawString that was being slow. I think that because the height of the table view was less than the height of the font, the function got stuck in an infinite loop and kept "wrapping" the line/increasing the value of yy until it overflowed, thereby eventually failing the check if ( yy < (yy + h) - charH ).

noodlecollie avatar Sep 27 '19 07:09 noodlecollie

Thanks for the report! I will look into it, as soon as throw off an illness and get back to my workstation.

a1batross avatar Sep 27 '19 14:09 a1batross