From 294b8d3c6e5a0d78b3326ca5a4db72cb657386c8 Mon Sep 17 00:00:00 2001 From: Akash Date: Sat, 17 Oct 2015 22:47:44 +0530 Subject: [PATCH] gsdx: use old size of target if ds and rt is null CID 146843 (#1 of 1): Dereference after null check (FORWARD_NULL)6. var_deref_model: Passing null pointer ds to GetSize, which dereferences it. --- plugins/GSdx/GSDeviceOGL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index 68e409d472..1e3e315ac2 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -1411,7 +1411,7 @@ void GSDeviceOGL::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVecto } - GSVector2i size = rt ? rt->GetSize() : ds->GetSize(); + GSVector2i size = rt ? rt->GetSize() : ds ? ds->GetSize() : GLState::viewport; if(GLState::viewport != size) { GLState::viewport = size;