Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Monado
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Peter Kovář
Monado
Commits
5fa58efc
Commit
5fa58efc
authored
Aug 01, 2019
by
Jakob Bornecrantz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
st/oxr: Verify width and height on swapchain create
parent
4ebc308a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
src/xrt/state_trackers/oxr/oxr_api_swapchain.c
src/xrt/state_trackers/oxr/oxr_api_swapchain.c
+3
-4
src/xrt/state_trackers/oxr/oxr_api_verify.h
src/xrt/state_trackers/oxr/oxr_api_verify.h
+8
-0
No files found.
src/xrt/state_trackers/oxr/oxr_api_swapchain.c
View file @
5fa58efc
...
...
@@ -59,10 +59,9 @@ oxr_xrCreateSwapchain(XrSession session,
OXR_VERIFY_ARG_NOT_NULL
(
&
log
,
out_swapchain
);
// Save people from shooting themselves in the foot.
if
(
createInfo
->
arraySize
<=
0
)
{
return
oxr_error
(
&
log
,
XR_ERROR_VALIDATION_FAILURE
,
"(createInfo->arraySize) must be non-zero"
);
}
OXR_VERIFY_ARG_NOT_ZERO
(
&
log
,
createInfo
->
arraySize
);
OXR_VERIFY_ARG_NOT_ZERO
(
&
log
,
createInfo
->
width
);
OXR_VERIFY_ARG_NOT_ZERO
(
&
log
,
createInfo
->
height
);
ret
=
sess
->
create_swapchain
(
&
log
,
sess
,
createInfo
,
&
sc
);
if
(
ret
!=
XR_SUCCESS
)
{
...
...
src/xrt/state_trackers/oxr/oxr_api_verify.h
View file @
5fa58efc
...
...
@@ -91,6 +91,14 @@ extern "C" {
} \
} while (false)
#define OXR_VERIFY_ARG_NOT_ZERO(log, arg) \
do { \
if (arg == 0) { \
return oxr_error(log, XR_ERROR_VALIDATION_FAILURE, \
"(" #arg " == 0) must be non-zero"); \
} \
} while (false)
#define OXR_VERIFY_ARG_TYPE_AND_NULL(log, arg, type_enum) \
do { \
if (arg == NULL) { \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment