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.
This commit is contained in:
Akash 2015-10-14 19:14:22 +05:30
parent b8caab5f3d
commit fedd07e4a8
1 changed files with 1 additions and 1 deletions

View File

@ -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;