Fix Grease Pencil render in VSE crashes when no strips (#T49975)

Solution as suggested by Sergey Sharybin. Initial debugging by
Antonio Vazquez.
This commit is contained in:
Dalai Felinto 2016-11-10 12:23:09 +01:00
parent 63b38848a2
commit 0b9b8ab2dd
Notes: blender-bot 2023-02-14 07:25:47 +01:00
Referenced by issue #50051, Grease Pencil + OpenGL crash in VSE
Referenced by issue #49975, Grease Pencil crash in VSE
1 changed files with 6 additions and 0 deletions

View File

@ -315,6 +315,12 @@ static void screen_opengl_render_doit(OGLRender *oglrender, RenderResult *rr)
RE_render_result_rect_from_ibuf(rr, &scene->r, out, oglrender->view_id);
IMB_freeImBuf(out);
}
else if (gpd){
/* If there are no strips, Grease Pencil still needs a buffer to draw on */
ImBuf *out = IMB_allocImBuf(oglrender->sizex, oglrender->sizey, 32, IB_rect);
RE_render_result_rect_from_ibuf(rr, &scene->r, out, oglrender->view_id);
IMB_freeImBuf(out);
}
if (gpd) {
int i;