зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1207478: P1. Prevent microseconds calculation overflow. r=gerald
This leaves us safe until year 294441 (assuming unix timestamp).
This commit is contained in:
Родитель
64c0a617b7
Коммит
7d65b942c5
|
@ -35,7 +35,9 @@ public:
|
|||
|
||||
Microseconds ToMicroseconds(int64_t aTimescaleUnits)
|
||||
{
|
||||
return aTimescaleUnits * 1000000ll / mTimescale;
|
||||
int64_t major = aTimescaleUnits / mTimescale;
|
||||
int64_t remainder = aTimescaleUnits % mTimescale;
|
||||
return major * 1000000ll + remainder * 1000000ll / mTimescale;
|
||||
}
|
||||
|
||||
uint64_t mCreationTime;
|
||||
|
|
Загрузка…
Ссылка в новой задаче