-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
ofPixels copy broken #8225
Comments
Good catch. https://github.com/openframeworks/openFrameworks/pull/8226/files
|
not that the doxygen is necessarily "truth" but in this case the commit message is not very verbose only mentionning a "critical flaw" -- what flaw/problem is changing the return of and since the subject is being brought up, how does |
Definitely in favor of your solution Dimitre for a quick regression fix.
Then we can look at the edge cases mentioned and make sure they are working in another PR?
|
I agree it is good to merge and we can think of edge cases. |
I posted a comment in the problematic commit but I'll add it here too as it's a 7 month old change...
Here's the commit: f7522b9#diff-7d727932e9b85218273507defcbf4b9e9c9a300c10d62867e1459b2f167b45f8L399
And the issue:
ofPixels.size()
was changed to return the number of bytes instead of the number of pixels, and that breaks copying with different data formats.If you try something like this:
then you get a buffer overrun in
copyFrom()
because the loop runs onofPixels.size()
.There's already an
ofPixels.getTotalBytes()
that returns the total bytes, why makesize()
return the same thing?The text was updated successfully, but these errors were encountered: