summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/volume9.c
diff options
context:
space:
mode:
authorPatrick Rudolph <[email protected]>2015-08-31 19:17:13 +0200
committerAxel Davy <[email protected]>2016-02-04 22:12:17 +0100
commit7f58ba45a8ef043fba98cdd56c122fe5e3091332 (patch)
treec8280e78e197dc51767b660751c637c8e1ebed92 /src/gallium/state_trackers/nine/volume9.c
parent35047681ffc1b48f09fe3cedc15c9889eecef907 (diff)
st/nine: Fix Volumetexture9_LockBox
Check for valid locked box dimensions. Fixes failing wine tests device.c test_lockbox_invalid. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/volume9.c')
-rw-r--r--src/gallium/state_trackers/nine/volume9.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/volume9.c b/src/gallium/state_trackers/nine/volume9.c
index 0b9005685a9..b559fc268ab 100644
--- a/src/gallium/state_trackers/nine/volume9.c
+++ b/src/gallium/state_trackers/nine/volume9.c
@@ -264,6 +264,13 @@ NineVolume9_LockBox( struct NineVolume9 *This,
usage |= PIPE_TRANSFER_DONTBLOCK;
if (pBox) {
+ user_assert(pBox->Right > pBox->Left, D3DERR_INVALIDCALL);
+ user_assert(pBox->Bottom > pBox->Top, D3DERR_INVALIDCALL);
+ user_assert(pBox->Back > pBox->Front, D3DERR_INVALIDCALL);
+ user_assert(pBox->Right <= This->desc.Width, D3DERR_INVALIDCALL);
+ user_assert(pBox->Bottom <= This->desc.Height, D3DERR_INVALIDCALL);
+ user_assert(pBox->Back <= This->desc.Depth, D3DERR_INVALIDCALL);
+
d3dbox_to_pipe_box(&box, pBox);
if (u_box_clip_2d(&box, &box, This->desc.Width, This->desc.Height) < 0) {
DBG("Locked volume intersection empty.\n");