From fedd07e4a8906c0c0ff80fb5bc382ba4ae93b4e9 Mon Sep 17 00:00:00 2001 From: Akash Date: Wed, 14 Oct 2015 19:14:22 +0530 Subject: [PATCH] gsdx: prevent a potential division by zero CID 146834 (#2-1 of 2): Division or modulo by zero (DIVIDE_BY_ZERO)9. divide_by_zero: In expression tpf * 10000ULL / ttpf, division by expression ttpf which may be zero has undefined behavior. --- plugins/GSdx/GSFunctionMap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/GSdx/GSFunctionMap.h b/plugins/GSdx/GSFunctionMap.h index 3e87ac6214..3876679cc3 100644 --- a/plugins/GSdx/GSFunctionMap.h +++ b/plugins/GSdx/GSFunctionMap.h @@ -125,7 +125,7 @@ public: KEY key = i->first; ActivePtr* p = i->second; - if(p->frames > 0) + if(p->frames && ttpf) { uint64 tpp = p->actual > 0 ? p->ticks / p->actual : 0; uint64 tpf = p->frames > 0 ? p->ticks / p->frames : 0;