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

libobs-opengl: Fix incompatible pointer type error for 32-bit arches #11349

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Conan-Kudo
Copy link
Contributor

Description

Fix a small pointer type error in libobs-opengl

Motivation and Context

It fixes a build for the library on 32-bit architectures.

How Has This Been Tested?

OBS Studio packages in Fedora has been shipping this since Fedora 40.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@tytan652
Copy link
Collaborator

tytan652 commented Oct 5, 2024

I'm quiet sure that 32 bit support was dropped since the complete switch to Qt6.

@kkartaltepe
Copy link
Collaborator

Our api expects a size_t pointer so callers will be sending in pointers to size_t. You will need to copy the size_t into a correctly sized variable first for this to be correct.

@WizardCM WizardCM added Bug Fix Non-breaking change which fixes an issue Linux Affects Linux labels Oct 5, 2024
@Lain-B
Copy link
Collaborator

Lain-B commented Oct 5, 2024

Is there any way to exclude 32bit builds? We generally just don't support 32bit right now. Because this cast is technically erroneous on 32bit and will cast a 32bit integer (size_t on 32bit) to 64bit (EGLuint64KHR which presumably is 64bit even on 32bit)

@Conan-Kudo
Copy link
Contributor Author

Conan-Kudo commented Oct 6, 2024

Honestly, the only reason I care is because of the vkcapture plugin... It needs a 32-bit libobs because it needs a 32-bit build for 32-bit games. ☹️

@norihiro
Copy link
Contributor

norihiro commented Oct 6, 2024

beside if 32-bit architecture is supported or not, casting a 32-bit integer pointer to a 64-bit integer would result in a buffer overrun. You should have a 64-bit integer local variable and pass the pointer of it. Then, cast the value of the variable to n_modifiers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue Linux Affects Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants