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

Fix buffer overflow when the count of display modes exceeds MaxModePe… #180

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

qiaojbao
Copy link
Collaborator

@qiaojbao qiaojbao commented Nov 5, 2024

…rScreen(64)

  1. Free pModeList memory when destroying instance
  2. Add protection when allocating memory for pModeList fails
  3. Avoid using an early return
  4. Remove the if condition of ppModeList == nullptr, it doesn't match the new calling conventions
  5. Always initialize variables

…rScreen(64)

1. Free pModeList memory when destroying instance
2. Add protection when allocating memory for pModeList fails
3. Avoid using an early return
4. Remove the if condition of ppModeList == nullptr, it doesn't match the new calling conventions
5. Always initialize variables
@qiaojbao qiaojbao requested a review from a team as a code owner November 5, 2024 07:17
@qiaojbao qiaojbao merged commit 786ec85 into dev Nov 5, 2024
6 of 7 checks passed
kleinerm added a commit to kleinerm/Psychtoolbox-3 that referenced this pull request Nov 5, 2024
…ure drivers.

AMDVLK v-2024.Q4.2 will have a suitable bug fix, so the workaround
ain't needed anymore on Navi+ / RDNA gpu's supported by that driver.

The fix is untested and not testable by myself as I don't have a
RDNA+ gpu, but I performed a full code review and conclude that
the bug should be fixed by that fix, which now implements dynamic
allocation of suitable data structures, so no hard mode count limit
anymore and future proof.

Bug report: GPUOpen-Drivers/xgl#179
Bugfix merged 5.11.2024: GPUOpen-Drivers/xgl#180
kleinerm pushed a commit to kleinerm/xgl that referenced this pull request Dec 13, 2024
…rScreen(64) (GPUOpen-Drivers#180)

1. Free pModeList memory when destroying instance
2. Add protection when allocating memory for pModeList fails
3. Avoid using an early return
4. Remove the if condition of ppModeList == nullptr, it doesn't match the new calling conventions
5. Always initialize variables

Co-authored-by: Li, Wenqing <[email protected]>
(cherry picked from commit 786ec85)
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