diff options
author | Antonioya <blendergit@gmail.com> | 2016-11-12 00:27:10 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2016-11-12 00:27:10 +0300 |
commit | 674c3bf89480a3278b3637d1dcfe37532f00711e (patch) | |
tree | a58a0e9f1c254b220250e2c63ff5406d9fe3ce06 /source/blender | |
parent | cdeaec3b0d151e020f532e0b2cc46742b41a379f (diff) |
Fix T49996: VSE opengl render crash with grease pencil if current frame is empty
If the opengl render with grease pencil is run from VSE with the current
frame outside visible frames, the render pass is wrong and the render
must be canceled because nothing to render. Related to #T49975
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index ea53c8764f2..16842efb436 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -485,23 +485,24 @@ static void add_gpencil_renderpass(OGLRender *oglrender, RenderResult *rr, Rende /* copy image data from rectf */ // XXX: Needs conversion. unsigned char *src = (unsigned char *)RE_RenderViewGetById(rr, oglrender->view_id)->rect32; - float *dest = rp->rect; - - int x, y, rectx, recty; - rectx = rr->rectx; - recty = rr->recty; - for (y = 0; y < recty; y++) { - for (x = 0; x < rectx; x++) { - unsigned char *pixSrc = src + 4 * (rectx * y + x); - if (pixSrc[3] > 0) { - float *pixDest = dest + 4 * (rectx * y + x); - float float_src[4]; - srgb_to_linearrgb_uchar4(float_src, pixSrc); - addAlphaOverFloat(pixDest, float_src); + if (src != NULL) { + float *dest = rp->rect; + + int x, y, rectx, recty; + rectx = rr->rectx; + recty = rr->recty; + for (y = 0; y < recty; y++) { + for (x = 0; x < rectx; x++) { + unsigned char *pixSrc = src + 4 * (rectx * y + x); + if (pixSrc[3] > 0) { + float *pixDest = dest + 4 * (rectx * y + x); + float float_src[4]; + srgb_to_linearrgb_uchar4(float_src, pixSrc); + addAlphaOverFloat(pixDest, float_src); + } } } } - /* back layer status */ i = 0; for (bGPDlayer *gph = gpd->layers.first; gph; gph = gph->next) { |