Fix integer overflow bug

max(uint32_t) * max(uint32_t) > max(int64_t)