fix framebuffer allocations

thanks to hascode