gsdx-ogl: check null pointer

CID 151735 (#1 of 1): Dereference after null check (FORWARD_NULL)
61. var_deref_model: Passing null pointer rt to CopyRectConv, which dereferences it
This commit is contained in:
Gregory Hainaut 2015-10-21 19:58:31 +02:00
parent d7afd7aae0
commit 826319ce34
1 changed files with 6 additions and 0 deletions

View File

@ -892,6 +892,10 @@ GSTexture* GSDeviceOGL::CopyOffscreen(GSTexture* src, const GSVector4& sRect, in
// Copy a sub part of texture (same as below but force a conversion)
void GSDeviceOGL::CopyRectConv(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r, bool at_origin)
{
ASSERT(sTex && dTex);
if (!(sTex && dTex))
return;
const GLuint& sid = sTex->GetID();
const GLuint& did = dTex->GetID();
@ -914,6 +918,8 @@ void GSDeviceOGL::CopyRectConv(GSTexture* sTex, GSTexture* dTex, const GSVector4
void GSDeviceOGL::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r)
{
ASSERT(sTex && dTex);
if (!(sTex && dTex))
return;
const GLuint& sid = sTex->GetID();
const GLuint& did = dTex->GetID();