diff --git a/plugins/GSdx/GSDevice11.cpp b/plugins/GSdx/GSDevice11.cpp index c51cdc2ace..58190b357a 100644 --- a/plugins/GSdx/GSDevice11.cpp +++ b/plugins/GSdx/GSDevice11.cpp @@ -518,6 +518,12 @@ GSTexture* GSDevice11::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, void GSDevice11::CopyRect(GSTexture* st, GSTexture* dt, const GSVector4i& r) { + if(!st || !dt) + { + ASSERT(0); + return; + } + D3D11_BOX box = {r.left, r.top, 0, r.right, r.bottom, 1}; m_ctx->CopySubresourceRegion(*(GSTexture11*)dt, 0, 0, 0, 0, *(GSTexture11*)st, 0, &box); @@ -535,6 +541,12 @@ void GSDevice11::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt, void GSDevice11::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear) { + if(!st || !dt) + { + ASSERT(0); + return; + } + BeginScene(); GSVector2i ds = dt->GetSize(); diff --git a/plugins/GSdx/GSDevice9.cpp b/plugins/GSdx/GSDevice9.cpp index e5dda141ea..855df86537 100644 --- a/plugins/GSdx/GSDevice9.cpp +++ b/plugins/GSdx/GSDevice9.cpp @@ -701,6 +701,12 @@ GSTexture* GSDevice9::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, void GSDevice9::CopyRect(GSTexture* st, GSTexture* dt, const GSVector4i& r) { + if(!st || !dt) + { + ASSERT(0); + return; + } + m_dev->StretchRect(*(GSTexture9*)st, r, *(GSTexture9*)dt, r, D3DTEXF_NONE); } @@ -716,6 +722,12 @@ void GSDevice9::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt, c void GSDevice9::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, Direct3DBlendState9* bs, bool linear) { + if(!st || !dt) + { + ASSERT(0); + return; + } + BeginScene(); GSVector2i ds = dt->GetSize(); diff --git a/plugins/GSdx/GSRendererHW.h b/plugins/GSdx/GSRendererHW.h index d6ef16cb18..a78cf8f50e 100644 --- a/plugins/GSdx/GSRendererHW.h +++ b/plugins/GSdx/GSRendererHW.h @@ -756,6 +756,12 @@ protected: GSTextureCache::Target* ds = m_tc->LookupTarget(TEX0, m_width, m_height, GSTextureCache::DepthStencil, m_context->DepthWrite()); + if(!rt || !ds) + { + ASSERT(0); + return; + } + GSTextureCache::Source* tex = NULL; if(PRIM->TME) diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 88a0e8a7c3..0fbbfa4923 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -736,7 +736,10 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con src->m_texture = dt; } - src->m_texture->SetScale(scale); + if( src->m_texture ) + src->m_texture->SetScale(scale); + else + ASSERT(0); switch(TEX0.PSM) {