st/nine: Fix crash on texture creation failure
Fixes regression introduced by:
a179ea2e
"st/nine: Use the texture memory helper"
The device is used on texture/surface dtor since this commit.
We need to early fill the device field in case of error.
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>
This commit is contained in:
parent
d9e79bfe4f
commit
204bc8981f
|
@ -54,6 +54,8 @@ NineCubeTexture9_ctor( struct NineCubeTexture9 *This,
|
|||
This, pParams, EdgeLength, Levels, Usage,
|
||||
Format, Pool, pSharedHandle);
|
||||
|
||||
This->base.base.base.device = pParams->device; /* Early fill this field in case of failure */
|
||||
|
||||
user_assert(EdgeLength, D3DERR_INVALIDCALL);
|
||||
|
||||
/* user_assert(!pSharedHandle || Pool == D3DPOOL_DEFAULT, D3DERR_INVALIDCALL); */
|
||||
|
|
|
@ -68,6 +68,7 @@ NineSurface9_ctor( struct NineSurface9 *This,
|
|||
|
||||
/* Mark this as a special surface held by another internal resource. */
|
||||
pParams->container = pContainer;
|
||||
This->base.base.device = pParams->device; /* Early fill this field in case of failure */
|
||||
/* Make sure there's a Desc */
|
||||
assert(pDesc);
|
||||
|
||||
|
|
|
@ -56,6 +56,8 @@ NineTexture9_ctor( struct NineTexture9 *This,
|
|||
HRESULT hr;
|
||||
struct nine_allocation *user_buffer = NULL, *user_buffer_for_level;
|
||||
|
||||
This->base.base.base.device = pParams->device; /* Early fill this field in case of failure */
|
||||
|
||||
DBG("(%p) Width=%u Height=%u Levels=%u Usage=%s Format=%s Pool=%s "
|
||||
"pSharedHandle=%p\n", This, Width, Height, Levels,
|
||||
nine_D3DUSAGE_to_str(Usage),
|
||||
|
|
Loading…
Reference in New Issue