Skip to content

Add NULL checks at tile::pull()#255

Closed
palemieux wants to merge 2 commits intoaous72:masterfrom
sandflow:issues/unchecked-pull_line-return
Closed

Add NULL checks at tile::pull()#255
palemieux wants to merge 2 commits intoaous72:masterfrom
sandflow:issues/unchecked-pull_line-return

Conversation

@palemieux
Copy link
Contributor

4536793000378368

@aous72
Copy link
Owner

aous72 commented Feb 24, 2026

Thank you for putting this. I think this is a bug somewhere else in the code. I need to get to the bottom of it.

@palemieux
Copy link
Contributor Author

Thank you for putting this. I think this is a bug somewhere else in the code. I need to get to the bottom of it.

pull_line() can return NULL, so this needs to be checked, right?

@aous72
Copy link
Owner

aous72 commented Feb 24, 2026

I am a bit blurry here. I think it is being called on a non-existing comp_num; if I recall correctly, this should not happen.

@aous72
Copy link
Owner

aous72 commented Feb 25, 2026

I tracked it down. The commit is messy because endline spaces are removed.
I did not use your PR.
I only added

      ui32 comp_width = recon_comp_rects[comp_num].siz.w;
      if (comp_width == 0)
        return true; // nothing to pull, but not an error

Remove the lines that repeat this line.

@aous72
Copy link
Owner

aous72 commented Feb 25, 2026

This was solved another way.
Thank you Pierre.

@aous72 aous72 closed this Feb 25, 2026
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.

2 participants