ImBuf *BKE_sequencer_give_ibuf(const SeqRenderData *context, float cfra, int chanshown)
{
Editing *ed = BKE_sequencer_editing_get(context->scene, false);
- int count;
ListBase *seqbasep;
if (ed == NULL) return NULL;
- count = BLI_countlist(&ed->metastack);
- if ((chanshown < 0) && (count > 0)) {
+ if ((chanshown < 0) && !BLI_listbase_is_empty(&ed->metastack)) {
+ int count = BLI_countlist(&ed->metastack);
count = max_ii(count + chanshown, 0);
seqbasep = ((MetaStack *)BLI_findlink(&ed->metastack, count))->oldbasep;
}