Skip to content

Fix bad pointer math #1977

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

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

kdt3rd
Copy link
Contributor

@kdt3rd kdt3rd commented Feb 9, 2025

In SSE, we were incrementing a pointer as if it were a uint16_t, not an si128, causing out of bounds accesses on non-block aligned chunks.

Similarly, simplify the alignment logic and check return values and pointers in related accesses (non-block aligned linear lut lookup).

Copy link
Contributor

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this lgtm. Is there a way to trigger the fault from our test suite? I assume this wasn't caught via testing.... A test that triggers without the fix would be a good safeguard against future work in the compressor?

Copy link
Member

@cary-ilm cary-ilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

In SSE, we were incrementing a pointer as if it were a uint16_t, not an
si128, causing out of bounds accesses on non-block aligned chunks.

Similarly, simplify the alignment logic and check return values and
pointers in related accesses (non-block aligned linear lut lookup).

Signed-off-by: Kimball Thurston <[email protected]>
@cary-ilm cary-ilm force-pushed the fix_dwa_buffer_read branch from dd77634 to c94c6ce Compare February 12, 2025 00:46
@kdt3rd
Copy link
Contributor Author

kdt3rd commented Feb 12, 2025

this lgtm. Is there a way to trigger the fault from our test suite? I assume this wasn't caught via testing.... A test that triggers without the fix would be a good safeguard against future work in the compressor?

yes, we would need a proper test for dwa encoding using the non-linear encoding table code than just the default linear encoding and then compile with sse on x86 (although that should be the case). I don't know if we have a test image with that non-linear encoding to know what is "right"?

@kdt3rd kdt3rd merged commit 1982b6f into AcademySoftwareFoundation:main Feb 12, 2025
36 checks passed
@kdt3rd kdt3rd deleted the fix_dwa_buffer_read branch February 12, 2025 07:47
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.

3 participants