
<     if (frame_end - frame < width + 3)
---
>     if (frame_end - frame < width + 4)
