[Bf-blender-cvs] [f230d15] multiview: fix for exr images not loading in Linux

Dalai Felinto noreply at git.blender.org
Tue Aug 5 15:48:07 CEST 2014


Commit: f230d15ce1ff0376cc34a10b241132e6bf685fb5
Author: Dalai Felinto
Date:   Tue Aug 5 15:32:21 2014 +0200
Branches: multiview
https://developer.blender.org/rBf230d15ce1ff0376cc34a10b241132e6bf685fb5

fix for exr images not loading in Linux

Note to self, go over the code and try to find other cases when I used BLI_snprintf to make sure I didnt use the same string as source and dest (it works in OSX, but not in Linux)

===================================================================

M	source/blender/imbuf/intern/openexr/openexr_api.cpp

===================================================================

diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index 07baf6d..be1f232 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -1467,13 +1467,16 @@ static ExrHandle *imb_exr_begin_read_mem(MultiPartInputFile *file, int width, in
 	for (echan = (ExrChannel *)data->channels.first; echan; echan = echan->next) {
 		if (imb_exr_split_channel_name(echan, layname, passname)) {
 
-			const char *view= echan->m->view.c_str();
+			const char *view = echan->m->view.c_str();
 			char internal_name[EXR_PASS_MAXNAME];
 
 			BLI_strncpy(internal_name, passname, EXR_PASS_MAXNAME);
 
-			if (view[0] != '\0')
-				BLI_snprintf(passname, sizeof(passname), "%s.%s", passname, view);
+			if (view[0] != '\0') {
+				char tmp_pass[EXR_PASS_MAXNAME];
+				BLI_snprintf(tmp_pass, sizeof(tmp_pass), "%s.%s", passname, view);
+				BLI_strncpy(passname, tmp_pass, sizeof(passname));
+			}
 
 			ExrLayer *lay = imb_exr_get_layer(&data->layers, layname);
 			ExrPass *pass = imb_exr_get_pass(&lay->passes, passname);




More information about the Bf-blender-cvs mailing list