-
Notifications
You must be signed in to change notification settings - Fork 24
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
Bug in LCDPattern #63
Comments
I suppose that pattern was dropped. Inner implementation of color is
So there's pointer to const array, temp value on stack. There's almost same implementation but with lifetime and ownership. |
Yikes! 😳 Yes, this is a use-after-free. Lines 36 to 46 in 5b289e5
The implementation in @boozook's crate (owned variant) has the same problem for the same reason. The return value from From what I can tell, the |
Agreed. This is next in my queue. |
Any suggestions? I'll look at it tomorrow. Here is deep night now. |
Also there is problem with
Update: |
I believe any lifetime will work. It just might be a bit of an ergonomics issue for users. I tested this yesterday with MIRI and it seemed ok (apart from the int-pointer casts, which raised some warnings). (edit: this is not in reference to |
Do I take it that the assignment means you want (one of us) to submit a PR for this issue? |
It with be great. |
The existing Pattern(LCDPattern) has memory issues. See pd-rs#63 for more details. Had to remove the TextSprite helper, but c'est la vie.
There seems to be a bug in the LCDPattern implementation. When using the
draw_line
method (and possibly others), the Pattern is drawn with random data (changes for example on button inputs) instead of the selected pattern (in my case a checkerboard for grayscale).This was only tested on the simulator though, as I don't have real hardware yet!
Here is an example. The leftmost line should have every second pixel on, but it's actually even more (and changes in more complex programs). The second line is supposed to be solid.
The text was updated successfully, but these errors were encountered: