From 15cfb375a39b9d9e35e8c83942edb8f43788427f Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Wed, 14 Jul 2021 20:38:18 -0300 Subject: Fix T89782: Segfault populating popup menu with dimensions above the opengl limit The crash happens because `GPU_offscreen_create` is called with `err_out` `NULL`. This patch proposes a solution within the `GPU_offscreen_create` itself and raises an error report in the interface if a menu is called with dimensions beyond what is supported. Ref T89782 Maniphest Tasks: T89782 Differential Revision: https://developer.blender.org/D11927 --- source/blender/gpu/intern/gpu_framebuffer.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index 1293cc0953d..4bb13d01c2d 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -609,7 +609,13 @@ GPUOffScreen *GPU_offscreen_create( } if ((depth && !ofs->depth) || !ofs->color) { - BLI_snprintf(err_out, 256, "GPUTexture: Texture allocation failed."); + const char error[] = "GPUTexture: Texture allocation failed."; + if (err_out) { + BLI_snprintf(err_out, 256, error); + } + else { + fprintf(stderr, error); + } GPU_offscreen_free(ofs); return nullptr; } -- cgit v1.2.3