diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2019-05-20 14:43:25 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2019-05-21 10:34:00 +0300 |
commit | bfe7fdedfc3b67fcdfcc962fee7fbe59a9c34458 (patch) | |
tree | 0c53db9a67e1ca9d6c6fc1489d0f888cf679a92e /source/blender/editors/space_image/image_buttons.c | |
parent | 2cec669d3456034adb41c9ab43598089f56f7554 (diff) |
Fix T64867: crash when changin image source to Movie
thx @Gvgeo for adding the python/RNA case as well.
Reviewers: brecht
Maniphest Tasks: T64867
Differential Revision: https://developer.blender.org/D4902
Diffstat (limited to 'source/blender/editors/space_image/image_buttons.c')
-rw-r--r-- | source/blender/editors/space_image/image_buttons.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 8fada528f48..b32f5ef6d9e 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -1254,7 +1254,10 @@ void uiTemplateImageInfo(uiLayout *layout, bContext *C, Image *ima, ImageUser *i int duration = 0; if (ima->source == IMA_SRC_MOVIE && BKE_image_has_anim(ima)) { - duration = IMB_anim_get_duration(((ImageAnim *)ima->anims.first)->anim, IMB_TC_RECORD_RUN); + struct anim *anim = ((ImageAnim *)ima->anims.first)->anim; + if (anim) { + duration = IMB_anim_get_duration(anim, IMB_TC_RECORD_RUN); + } } if (duration > 0) { |