Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: cannot create std::vector larger than max_size() #59

Open
yazun opened this issue Jun 2, 2022 · 3 comments
Open

Error: cannot create std::vector larger than max_size() #59

yazun opened this issue Jun 2, 2022 · 3 comments

Comments

@yazun
Copy link

yazun commented Jun 2, 2022

It seems we hit a regression when trying to use the tween_component

image

Error: cannot create std::vector larger than max_size()
In addition: Warning message:
In numeric_element_interpolator(as.numeric(data), as.integer(group),  :
  NAs introduced by coercion to integer range

This is most likely line 24 (ease_seq) in numeric_element_interpolator fn:

21        for (i = 1; i < data.size(); ++i) {
22          if (current_group == group[i]) {
23            int nframes = frame[i] - frame[i-1];
24            std::vector<double> ease_points = ease_seq(ease[i-1], nframes);
25            for (size_t j = 0; j < ease_points.size(); ++j) {
26              tweendata.push_back(data[i - 1] + ease_points[j] * (data[i] - data[i - 1]));
27              tweengroup.push_back(current_group);
28              tweenframe.push_back(j + frame[i-1]);
29            }
30          } else {

Do you have any hints why this could happen?
Thanks

@yazun
Copy link
Author

yazun commented Jun 2, 2022

I guess nframes at line 23 gets negative? When this could happen.

@yazun
Copy link
Author

yazun commented Jun 2, 2022

Thread 1 "R" hit Breakpoint 6, ease_seq (easer="linear", length=-7) at utils.h:77
77      static inline std::vector<double> ease_seq(std::string easer, int length) {
(gdb) n
80            new_allocator() _GLIBCXX_USE_NOEXCEPT { }
(gdb)
78        std::vector<double> res(length);
(gdb) p length
$2 = -7

@thomasp85
Copy link
Owner

Hum... can you provide a reproducible example so I can investigate on my end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants