From 4a8839c99dc6e600d57a5ec60a87156c1ea0cc64 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 19 Mar 2020 20:56:24 -0700 Subject: [PATCH] GPU: Avoid divide by zero in garbage displaylist. --- GPU/Common/TextureDecoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/Common/TextureDecoder.cpp b/GPU/Common/TextureDecoder.cpp index b4bf87adfa..68056ce4cd 100644 --- a/GPU/Common/TextureDecoder.cpp +++ b/GPU/Common/TextureDecoder.cpp @@ -93,7 +93,7 @@ u32 GetTextureBufw(int level, u32 texaddr, GETextureFormat format) { return gstate.texbufwidth[level] & 0x1FFF; u32 bufw = gstate.texbufwidth[level] & textureAlignMask16[format]; - if (bufw == 0) { + if (bufw == 0 && format <= GE_TFMT_DXT5) { // If it's less than 16 bytes, use 16 bytes. bufw = (8 * 16) / textureBitsPerPixel[format]; }