summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/surface9.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/nine/surface9.c')
-rw-r--r--src/gallium/state_trackers/nine/surface9.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/nine/surface9.c b/src/gallium/state_trackers/nine/surface9.c
index d20e62a897f..78c29ca5a81 100644
--- a/src/gallium/state_trackers/nine/surface9.c
+++ b/src/gallium/state_trackers/nine/surface9.c
@@ -323,6 +323,13 @@ NineSurface9_LockRect( struct NineSurface9 *This,
nine_D3DLOCK_to_str(Flags));
NineSurface9_Dump(This);
+ /* check if it's already locked */
+ user_assert(This->lock_count == 0, D3DERR_INVALIDCALL);
+
+ /* set pBits to NULL after lock_count check */
+ user_assert(pLockedRect, E_POINTER);
+ pLockedRect->pBits = NULL;
+
#ifdef NINE_STRICT
user_assert(This->base.pool != D3DPOOL_DEFAULT ||
(resource && (resource->flags & NINE_RESOURCE_FLAG_LOCKABLE)),
@@ -337,10 +344,6 @@ NineSurface9_LockRect( struct NineSurface9 *This,
user_assert(!((Flags & D3DLOCK_DISCARD) && (Flags & D3DLOCK_READONLY)),
D3DERR_INVALIDCALL);
- /* check if it's already locked */
- user_assert(This->lock_count == 0, D3DERR_INVALIDCALL);
- user_assert(pLockedRect, E_POINTER);
-
user_assert(This->desc.MultiSampleType == D3DMULTISAMPLE_NONE,
D3DERR_INVALIDCALL);