Fix T38353: some EXR files from other applications not loading correctly.

* 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.
This commit is contained in:
Brecht Van Lommel 2014-01-25 17:44:15 +01:00
parent b46dcafa7a
commit 70e844ea11
Notes: blender-bot 2023-02-14 11:17:59 +01:00
Referenced by issue #38353, EXRs generated by Arnold/Maya do not load correctly in the compositor
2 changed files with 9 additions and 2 deletions

View 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;
}

View 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;