Fix T38353: some EXR files from other applications not loading correctly.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sat, 25 Jan 2014 16:44:15 +0000 (17:44 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Sat, 25 Jan 2014 16:44:15 +0000 (17:44 +0100)
* EXR layers with names like 'Z' without any pass name were not loaded at all
  and would break the Combined pass as well.
* EXR pass names longer than 16 characters where writing past the end of the
  array and getting invalid names.

source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/render/extern/include/RE_pipeline.h

index b25a224e16cbf37cc7d43e7722329a51f699bf3c..9fa69194deda9c782d71a83dffe76a81616bbd30 100644 (file)
@@ -891,7 +891,14 @@ static int imb_exr_split_channel_name(ExrChannel *echan, char *layname, char *pa
        if (name[1] == 0) {
                echan->chan_id = name[0];
                layname[0] = '\0';
-               strcpy(passname, "Combined");
+
+               if (ELEM4(name[0], 'R', 'G', 'B', 'A'))
+                       strcpy(passname, "Combined");
+               else if (name[0] == 'Z')
+                       strcpy(passname, "Depth");
+               else
+                       strcpy(passname, name);
+
                return 1;
        }
 
index 4c15ddd6833759566c4781daf29a1e5cd2580bca..32c0a1d8535c1be06109bc40fdc4c4809fa092d5 100644 (file)
@@ -68,7 +68,7 @@ typedef struct Render Render;
 typedef struct RenderPass {
        struct RenderPass *next, *prev;
        int passtype, channels;
-       char name[16];          /* amount defined in openexr_multi.h */
+       char name[64];          /* amount defined in openexr_multi.h */
        char chan_id[8];        /* amount defined in openexr_multi.h */
        float *rect;
        int rectx, recty;