Fix lint new API issue.
Prevent crash by ensuring no negative duration.