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

Surface generation code does not clip properly #2

Open
Grumbel opened this issue Sep 10, 2018 · 0 comments
Open

Surface generation code does not clip properly #2

Grumbel opened this issue Sep 10, 2018 · 0 comments

Comments

@Grumbel
Copy link
Member

Grumbel commented Sep 10, 2018

The only thing the code currently does to prevent blitted glyphs from going outside of the surfaces pixels is this line of code:

   /* Adding bound checking to avoid all kinds of memory corruption errors
      that may occur. */
   dst_check = (Uint8*)textbuf->pixels + textbuf->pitch * textbuf->h;

However that will only prevent memory overruns, it does not actually clip properly, so glyphs at the right edge might overdraw and end up showing up on the left.

ef0b2f8 fixes one occurance of this, but the glyph blitting code is copy&pasted in numerous places. So this needs further work and should be refactored to fix this properly. Some test cases wouldn't hurt either.

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

1 participant