quibble
quibble copied to clipboard
Fix framebuffer overflow when drawing timer rect
Is there an actual bug you're fixing here? The only way I could see this triggering is if you chose a ludicrously large font size.
Is there an actual bug you're fixing here? The only way I could see this triggering is if you chose a ludicrously large font size.
Yes. I didn't change the font size - it still depends on the dpi. Out-of-range access occurs when the resolution is 2048x2048 (which is the max mode in Simics) in this code:
p.y = gop_info.VerticalResolution - (font_height * 3 / 4);
draw_rect(p.x, p.y - font_height, font_height * 5, font_height * 2, 0x000000);
font_height == 23 p.y == 2031 p.y - font_height == 2008 font_height * 2 == 46
2008 + 46 > 2048
I think the rect height there can be changed to (font_height * 7 / 4)
I'll update PR
I don't see why it shouldn't be merged.
Thanks for this, you're right. I've fixed it with https://github.com/maharmstone/quibble/commit/f98986d884bd825572111f58e905d2e1bb1b7ba0.
Rather than working out what the height of the rectangle should be, the easiest way was just to draw it to the bottom of the screen.