BKE_tracking_next shouldn't be called if there's nothing to track. Fixed in trunk, would be fixed here after upcoming merge.