diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-21 09:00:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-21 09:02:27 +0300 |
commit | ae00011956fc09266ea867857557536e97d1fffa (patch) | |
tree | d10593f7a4f389e372fc85e3ddb664d20b3d1348 /source/blender/editors/render/render_preview.c | |
parent | 9eb6dcbb46564547f5a8125905de6ad7724534a5 (diff) |
Fix T45496: Crash loading file during preview
Regression from multi-view
Diffstat (limited to 'source/blender/editors/render/render_preview.c')
-rw-r--r-- | source/blender/editors/render/render_preview.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 9ed0cec5545..0a7455ba407 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -559,10 +559,16 @@ static bool ed_preview_draw_rect(ScrArea *sa, int split, int first, rcti *rect, RE_AcquireResultImageViews(re, &rres); - /* material preview only needs monoscopy (view 0) */ - rv = RE_RenderViewGetById(&rres, 0); + if (!BLI_listbase_is_empty(&rres.views)) { + /* material preview only needs monoscopy (view 0) */ + rv = RE_RenderViewGetById(&rres, 0); + } + else { + /* possible the job clears the views but we're still drawing T45496 */ + rv = NULL; + } - if (rv->rectf) { + if (rv && rv->rectf) { if (ABS(rres.rectx - newx) < 2 && ABS(rres.recty - newy) < 2) { |