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

Handle begy/begx and leny/lenx #2819

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vysheng
Copy link

@vysheng vysheng commented Dec 20, 2024

Currently using begy/begx or leny/lenx results in wrong behavior or segmentation faults.

I tested it on kitty and foot:

  • asking notcurses to allocate a plane always results in the whole image being rendered
  • supplying a properly sized plane results in SIGSEGV on foot and only the top of the image being rendered on kitty

The reason for this behavour is missing handling of these fields' values. I see two possible solutions to fix this behavior:

  1. crop the image in functions like ncvisual_blit and leave everything else as it is
  2. fix all functions, so that they check the values of corresponding fields

I would say, that the variant (1) is less intrusive, so I implemented it. No tests ever used non-zero values for begx/begy, so the tests weren't broken.

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

Successfully merging this pull request may close these issues.

1 participant