Fix potential crash when changing the internal res to 1x while subpixel precision is enabled

This commit is contained in:
Lionel Flandrin 2016-02-12 17:32:00 +01:00
parent d80be2a251
commit 8f3c888b84

View File

@ -112,8 +112,10 @@ PS_GPU::PS_GPU(const PS_GPU &g, uint8 ushift)
if (g.SubpixelVertexCache) {
// Subpixel vertex cache is enabled, transfer the data
EnableSubpixelVertexCache(true);
memcpy(SubpixelVertexCache, g.SubpixelVertexCache,
0x1000 * 0x1000 * sizeof(*SubpixelVertexCache));
if (SubpixelVertexCache) {
memcpy(SubpixelVertexCache, g.SubpixelVertexCache,
0x1000 * 0x1000 * sizeof(*SubpixelVertexCache));
}
}
}