libobs-d3d11: Guard CreateTexture2D against SEH faults#13183
Closed
prgmitchell wants to merge 1 commit intoobsproject:masterfrom
Closed
libobs-d3d11: Guard CreateTexture2D against SEH faults#13183prgmitchell wants to merge 1 commit intoobsproject:masterfrom
prgmitchell wants to merge 1 commit intoobsproject:masterfrom
Conversation
Catch structured exceptions around CreateTexture2D, return E_FAIL so this is handled gracefully.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Catch structured exceptions around CreateTexture2D, return E_FAIL so this is handled gracefully instead of crashing OBS.
Motivation and Context
I saw reports of a crash when adding an image using an image source that is 16000x9000px. Although the Microsoft documentation states that the D3D size limit per side is 16384 for a 2D texture, large images like the one attached below cause an exception to be thrown in the driver call path for both AMD and NVIDIA drivers when testing.
How Has This Been Tested?
Fixes the crash with the above image and logs the error as expected
19:10:35.641: CreateTexture2D raised structured exception 0xC0000005 (width=16000 height=9000 format=27) 19:10:35.642: device_texture_create (D3D11): Failed to create 2D texture (80004005)This is an area of OBS I am not very familiar with but wanted to PR since I took the time to research and work on a fix, open to feedback of whether or not this approach is the correct way to fix this or if there are further implications to this change that I do not understand.
Types of changes
Checklist: