nv2a: Fix buffer size in surface flip

This commit is contained in:
Matt Borgerson 2021-02-10 23:13:26 -07:00 committed by mborgerson
parent afed1a4835
commit 7926347c8b
1 changed files with 2 additions and 1 deletions

View File

@ -4284,7 +4284,8 @@ static void pgraph_upload_surface_data(
}
// This is VRAM so we can't do this inplace!
uint8_t *flipped_buf = (uint8_t*)g_malloc(surface->size);
uint8_t *flipped_buf = (uint8_t *)g_malloc(
surface->height * surface->width * surface->bytes_per_pixel);
unsigned int irow;
for (irow = 0; irow < surface->height; irow++) {
memcpy(&flipped_buf[surface->width * (surface->height - irow - 1)