Bug 1028514 - Check for integer overflow when converting from floating-point number...
commit51cf0526d8e647c2c3083d4544b444f8409a36a1
authorBrian Birtles <birtles@gmail.com>
Wed, 25 Jun 2014 00:42:18 +0000 (25 09:42 +0900)
committerBrian Birtles <birtles@gmail.com>
Wed, 25 Jun 2014 00:42:18 +0000 (25 09:42 +0900)
treedeba60118580c5bc23824fa4c49207c7ff32d949
parente6944ee8af5f216619b693282d814ff275e1f9cc
Bug 1028514 - Check for integer overflow when converting from floating-point number milliseconds; r=froydnj

In TimeStamp_windows.cpp and TimeStamp_darwin.cpp, in
TimeStamp::FromMilliseconds we cast the floating-point number of ticks to
a 64-bit integer before passing to TimeStamp::FromTicks(int64_t).
This means that we skip the check for integer overflow performed by
TimeStamp::FromTicks(double).

This patch simply removes that cast so that we perform overflow checking.

It also adds an assertion to ElementAnimation since this is one place where
the lack of overflow checking was producing a negative value where it should
not.
layout/style/AnimationCommon.cpp
layout/style/crashtests/1028514-1.html [new file with mode: 0644]
layout/style/crashtests/crashtests.list
xpcom/ds/TimeStamp_darwin.cpp
xpcom/ds/TimeStamp_windows.cpp