prevent int32 multiplication overflow
Merge pull request #1005 from huili2/rc_overflow

prevent int32 multiplication overflow