From 3c8719f9458d4f210f27e827d89ad86234717232 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 8 Aug 2016 22:35:26 +0200 Subject: [PATCH] Fix buffer overflow in FTexture::GenerateBgraMipmaps --- src/textures/texture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index 7dfe04b23..05574e9da 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -482,7 +482,7 @@ void FTexture::GenerateBgraMipmaps() if (a < 0) a = h - 1; if (a == h) a = 0; if (b < 0) b = w - 1; - if (b == h) b = 0; + if (b == w) b = 0; c = c + dest[a + b * h]; } }