Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-10-17 12:51:05 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-01-01 17:54:54 +0300
commit3a1ade22e5eb720fb0069ff9ea7227f8e8e1c857 (patch)
tree317c1ce05d06b6f21f16e11c007f2645fe137954
parentb5c629e604d9d6cad3e41d86afb2c786acf6dd98 (diff)
GPU: Fix memory corruption in GPU_debug on GTX1080
Number of texture formats is 51, which is greater than allowed size of 32.
-rw-r--r--source/blender/gpu/intern/gpu_debug.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_debug.c b/source/blender/gpu/intern/gpu_debug.c
index 7a0562617d6..73133a6caab 100644
--- a/source/blender/gpu/intern/gpu_debug.c
+++ b/source/blender/gpu/intern/gpu_debug.c
@@ -425,9 +425,11 @@ void GPU_assert_no_gl_errors(const char *file, int line, const char *str)
static void gpu_state_print_fl_ex(const char *name, GLenum type)
{
+#define MAX_ARRAY_SIZE 64
+
const unsigned char err_mark[4] = {0xff, 0xff, 0xff, 0xff};
- float value[32];
+ float value[MAX_ARRAY_SIZE];
int a;
memset(value, 0xff, sizeof(value));
@@ -435,7 +437,7 @@ static void gpu_state_print_fl_ex(const char *name, GLenum type)
if (glGetError() == GL_NO_ERROR) {
printf("%s: ", name);
- for (a = 0; a < 32; a++) {
+ for (a = 0; a < MAX_ARRAY_SIZE; a++) {
if (memcmp(&value[a], err_mark, sizeof(value[a])) == 0) {
break;
}
@@ -443,6 +445,8 @@ static void gpu_state_print_fl_ex(const char *name, GLenum type)
}
printf("\n");
}
+
+#undef MAX_ARRAY_SIZE
}
#define gpu_state_print_fl(val) gpu_state_print_fl_ex(#val, val)