Does it fix it to just replace these two lines with:

int drawing_width = 512, drawing_height = 512;

Of course, this will make the framebuffers -> memory feature guarantee overwriting vram in the vast majority of cases...

-[Unknown]