From 2430abed3342ec09c3708011881a00e47e55a928 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 10 Sep 2015 17:06:03 +0200 Subject: [PATCH] gsdx: potential division by zero CID 146833 (#2-1 of 2): Division or modulo by zero (DIVIDE_BY_ZERO) divide_by_zero: In expression this->m_width / this->m_upscale_multiplier, division by expression this->m_upscale_multiplier which may be zero has undefined behavior. --- plugins/GSdx/GSRendererHW.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index 5eb7206b90..640c203c5b 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -81,7 +81,8 @@ void GSRendererHW::SetScaling() { } - printf("Frame buffer size set to %dx%d (%dx%d)\n", (m_width / m_upscale_multiplier), (m_height / m_upscale_multiplier), m_width, m_height); + if (m_upscale_multiplier) + printf("Frame buffer size set to %dx%d (%dx%d)\n", (m_width / m_upscale_multiplier), (m_height / m_upscale_multiplier), m_width, m_height); } GSRendererHW::~GSRendererHW()