diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-02 12:20:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-02 12:20:30 +0400 |
commit | 8276989f63267c906fcf933dcf557bc35fa1cb8c (patch) | |
tree | 11e798b78b5bcf7191d33f314f7be869d5c61fbe /source/blender/editors | |
parent | 1d9ddcd319908f6442b02623f7782413ecefa40a (diff) |
fix [#28460] SEGFAULT when trying to make empty display as image
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 8010a41ccb3..bb710a32794 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1177,29 +1177,34 @@ static size_t animfilter_nla (bAnimContext *UNUSED(ac), ListBase *anim_data, bDo /* determine what animation data from AnimData block should get displayed */ static size_t animfilter_block_data (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *id, int filter_mode) { - IdAdtTemplate *iat = (IdAdtTemplate*)id; AnimData *adt = BKE_animdata_from_id(id); size_t items = 0; - - /* NOTE: this macro is used instead of inlining the logic here, since this sort of filtering is still needed - * in a few places in he rest of the code still - notably for the few cases where special mode-based - * different types of data expanders are required. - */ - ANIMDATA_FILTER_CASES(iat, - { /* AnimData */ - /* specifically filter animdata block */ - ANIMCHANNEL_NEW_CHANNEL(adt, ANIMTYPE_ANIMDATA, id); - }, - { /* NLA */ - items += animfilter_nla(ac, anim_data, ads, adt, filter_mode, id); - }, - { /* Drivers */ - items += animfilter_fcurves(anim_data, ads, adt->drivers.first, NULL, filter_mode, id); - }, - { /* Keyframes */ - items += animfilter_action(ac, anim_data, ads, adt->action, filter_mode, id); - }); - + + /* image object datablocks have no anim-data so check for NULL */ + if(adt) { + IdAdtTemplate *iat = (IdAdtTemplate*)id; + + /* NOTE: this macro is used instead of inlining the logic here, since this sort of filtering is still needed + * in a few places in he rest of the code still - notably for the few cases where special mode-based + * different types of data expanders are required. + */ + ANIMDATA_FILTER_CASES(iat, + { /* AnimData */ + /* specifically filter animdata block */ + ANIMCHANNEL_NEW_CHANNEL(adt, ANIMTYPE_ANIMDATA, id); + }, + { /* NLA */ + items += animfilter_nla(ac, anim_data, ads, adt, filter_mode, id); + }, + { /* Drivers */ + items += animfilter_fcurves(anim_data, ads, adt->drivers.first, NULL, filter_mode, id); + }, + { /* Keyframes */ + items += animfilter_action(ac, anim_data, ads, adt->action, filter_mode, id); + } + ); + } + return items; } |