Fix (unreported) crash in 'Match movie length operator' in case of lost video texture file
This commit is contained in:
parent
d0335796a8
commit
b47c912f4b
|
@ -1475,7 +1475,10 @@ static int image_match_len_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
if (!ima || !iuser || !BKE_image_has_anim(ima))
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
iuser->frames = IMB_anim_get_duration(((ImageAnim *) ima->anims.first)->anim, IMB_TC_RECORD_RUN);
|
||||
struct ImageAnim *anim = ((ImageAnim *)ima->anims.first)->anim;
|
||||
if (!anim)
|
||||
return OPERATOR_CANCELLED;
|
||||
iuser->frames = IMB_anim_get_duration(anim, IMB_TC_RECORD_RUN);
|
||||
BKE_image_user_frame_calc(iuser, scene->r.cfra, 0);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
|
|
Loading…
Reference in New Issue