diff --git a/rpcs3/Emu/RSX/GL/GLTexture.cpp b/rpcs3/Emu/RSX/GL/GLTexture.cpp index 17276da052..8e59389c22 100644 --- a/rpcs3/Emu/RSX/GL/GLTexture.cpp +++ b/rpcs3/Emu/RSX/GL/GLTexture.cpp @@ -606,7 +606,8 @@ namespace gl // The rest of sampler state is now handled by sampler state objects // Calculate staging buffer size - size_t texture_data_sz = depth * height * width * get_format_block_size_in_bytes(gcm_format); + const u32 aligned_pitch = align(width * get_format_block_size_in_bytes(gcm_format), 4); + size_t texture_data_sz = depth * height * aligned_pitch; std::vector data_upload_buf(texture_data_sz); const auto format_type = get_format_type(gcm_format);