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:
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture.c')
-rw-r--r--source/blender/gpu/intern/gpu_texture.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index e2aa26c3b33..5398db82586 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -645,10 +645,12 @@ GPUTexture *GPU_texture_create_nD(
tex->bindcode = GPU_tex_alloc();
if (!tex->bindcode) {
- if (err_out)
- BLI_snprintf(err_out, 256, "GPUTexture: texture create failed\n");
- else
+ if (err_out) {
+ BLI_strncpy(err_out, "GPUTexture: texture create failed\n", 256);
+ }
+ else {
fprintf(stderr, "GPUTexture: texture create failed\n");
+ }
GPU_texture_free(tex);
return NULL;
}
@@ -685,7 +687,7 @@ GPUTexture *GPU_texture_create_nD(
if (!valid) {
if (err_out) {
- BLI_snprintf(err_out, 256, "GPUTexture: texture alloc failed\n");
+ BLI_strncpy(err_out, "GPUTexture: texture alloc failed\n", 256);
}
else {
fprintf(stderr, "GPUTexture: texture alloc failed. Likely not enough Video Memory.\n");
@@ -790,10 +792,12 @@ static GPUTexture *GPU_texture_cube_create(
tex->bindcode = GPU_tex_alloc();
if (!tex->bindcode) {
- if (err_out)
- BLI_snprintf(err_out, 256, "GPUTexture: texture create failed\n");
- else
+ if (err_out) {
+ BLI_strncpy(err_out, "GPUTexture: texture create failed\n", 256);
+ }
+ else {
fprintf(stderr, "GPUTexture: texture create failed\n");
+ }
GPU_texture_free(tex);
return NULL;
}