ref: 943f9c0356204683e295288e0bd8558abc98ae03
parent: c3f095c8b3c6eac510e892a7624162da1a655593
author: James Zern <[email protected]>
date: Thu Feb 9 14:28:59 EST 2017
vpx_usec_timer_elapsed: use 64-bit math this prevents a rollover when tv_sec is a long: signed integer overflow: 2776 * 1000000 cannot be represented in type 'long' Change-Id: I03dc4476ee122b02e2856dad28358a20cf16a9f8
--- a/vpx_ports/vpx_timer.h
+++ b/vpx_ports/vpx_timer.h
@@ -83,7 +83,7 @@
struct timeval diff;
timersub(&t->end, &t->begin, &diff);
- return diff.tv_sec * 1000000 + diff.tv_usec;
+ return (int64_t)diff.tv_sec * 1000000 + diff.tv_usec;
#endif
}