diff options
author | Matt Ebb <matt@mke3.net> | 2008-02-13 16:36:35 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2008-02-13 16:36:35 +0300 |
commit | e26b5aa9c47fbc604c23efe9100940ff68d8ddbe (patch) | |
tree | 3b00042e1c2c37e2be7a7fd04a183faa7c6276d1 /source/blender | |
parent | 08d54e71eaf7624dec3bb473dfa941faa04b85af (diff) |
* fix for [#8085] Glare node crashes on inputs with < 4 colour channels
I had this assigned to Alfredo for a while, but he hasn't replied to the tracker at all, so I suspect he's not around. I'll commit this now to prevent crashes.
Some of the code in the glare node assumed that all buffers will be 4 channel RGBA, when in fact it was possible to give it a VEC3, such as a spec pass with no alpha, which would crash it. This fix just duplicates the input to a new temporary RGBA buffer to work on, if it's not already RGBA.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_glare.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_glare.c b/source/blender/nodes/intern/CMP_nodes/CMP_glare.c index e7b8fd00c93..9ab4038607f 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_glare.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_glare.c @@ -424,15 +424,18 @@ static void fglow(NodeGlare* ndg, CompBuf* dst, CompBuf* src) static void node_composit_exec_glare(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { - CompBuf *new, *img = in[0]->data; + CompBuf *new, *src, *img = in[0]->data; NodeGlare* ndg = node->storage; if ((img == NULL) || (out[0]->hasoutput == 0)) return; - if (img->type != CB_RGBA) + if (img->type != CB_RGBA) { new = typecheck_compbuf(img, CB_RGBA); - else + src = typecheck_compbuf(img, CB_RGBA); + } else { new = dupalloc_compbuf(img); + src = dupalloc_compbuf(img); + } { int x, y; @@ -448,19 +451,20 @@ static void node_composit_exec_glare(void *data, bNode *node, bNodeStack **in, b switch (ndg->type) { case 0: - star4(ndg, new, img); + star4(ndg, new, src); break; case 1: - fglow(ndg, new, img); + fglow(ndg, new, src); break; case 3: - ghosts(ndg, new, img); + ghosts(ndg, new, src); break; case 2: default: - streaks(ndg, new, img); + streaks(ndg, new, src); } + free_compbuf(src); out[0]->data = new; } |