From 5b225ad59f4fdd7bec733abb2e3bf0d5e285d7b1 Mon Sep 17 00:00:00 2001 From: raven02 Date: Wed, 24 Aug 2016 21:19:16 +0800 Subject: [PATCH] GL: ignore texture upload if invalid dimension found (#2097) --- rpcs3/Emu/RSX/GL/gl_texture_cache.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/GL/gl_texture_cache.h b/rpcs3/Emu/RSX/GL/gl_texture_cache.h index 9e27e7247d..123e727f83 100644 --- a/rpcs3/Emu/RSX/GL/gl_texture_cache.h +++ b/rpcs3/Emu/RSX/GL/gl_texture_cache.h @@ -497,6 +497,12 @@ namespace gl obj->gl_id = 0; } + if (!tex.width() || !tex.height()) + { + LOG_ERROR(RSX, "Texture upload requested but invalid texture dimensions passed"); + return; + } + __glcheck gl_texture.init(index, tex); gl_cached_texture &_obj = create_obj_for_params(gl_texture.id(), texaddr, tex.width(), tex.height(), tex.get_exact_mipmap_count()); @@ -669,4 +675,4 @@ namespace gl return false; } }; -} \ No newline at end of file +}