Fix potential integer overflow.
Fix potential integer overflow.

ioc found a potential integer overflow in the rate control.

This is related to https://code.google.com/p/webm/issues/detail?id=821

Change-Id: Ib6c4acd6e964972f932fce7490592eb134f2b7ea

smarter/aom,luctrudeau/aom,reimaginemedia/webm.libvpx,shyamalschandra/libvpx,lyx2014/libvpx_c,jacklicn/webm.libvpx,kalli123/webm.libvpx,luctrudeau/aom,iniwf/webm.libvpx,jacklicn/webm.libvpx,ittiamvpx/libvpx-1,shacklettbp/aom,webmproject/libvpx,stewnorriss/libvpx,shacklettbp/aom,gshORTON/webm.libvpx,stewnorriss/libvpx,Topopiccione/libvpx,zofuthan/libvpx,running770/libvpx,mbebenita/aom,reimaginemedia/webm.libvpx,running770/libvpx,pcwalton/libvpx,shyamalschandra/libvpx,Acidburn0zzz/webm.libvpx,iniwf/webm.libvpx,matanbs/vp982,Distrotech/libvpx,ittiamvpx/libvpx-1,jmvalin/aom,GrokImageCompression/aom,kim42083/webm.libvpx,altogother/webm.libvpx,altogother/webm.libvpx,webmproject/libvpx,shareefalis/libvpx,gshORTON/webm.libvpx,lyx2014/libvpx_c,charup/https---github.com-webmproject-libvpx-,thdav/aom,lyx2014/libvpx_c,running770/libvpx,kleopatra999/webm.libvpx,VTCSecureLLC/libvpx,running770/libvpx,Topopiccione/libvpx,Laknot/libvpx,lyx2014/libvpx_c,shyamalschandra/libvpx,pcwalton/libvpx,shyamalschandra/libvpx,jacklicn/webm.libvpx,altogother/webm.libvpx,Laknot/libvpx,kalli123/webm.libvpx,Laknot/libvpx,hsueceumd/test_hui,jacklicn/webm.libvpx,charup/https---github.com-webmproject-libvpx-,smarter/aom,thdav/aom,shacklettbp/aom,jdm/libvpx,reimaginemedia/webm.libvpx,altogother/webm.libvpx,abwiz0086/webm.libvpx,kleopatra999/webm.libvpx,iniwf/webm.libvpx,Suvarna1488/webm.libvpx,VTCSecureLLC/libvpx,pcwalton/libvpx,mwgoldsmith/libvpx,Suvarna1488/webm.libvpx,goodleixiao/vpx,felipebetancur/libvpx,mwgoldsmith/libvpx,charup/https---github.com-webmproject-libvpx-,charup/https---github.com-webmproject-libvpx-,ShiftMediaProject/libvpx,mbebenita/aom,felipebetancur/libvpx,gshORTON/webm.libvpx,ittiamvpx/libvpx-1,Distrotech/libvpx,ShiftMediaProject/libvpx,kalli123/webm.libvpx,Acidburn0zzz/webm.libvpx,goodleixiao/vpx,matanbs/webm.libvpx,shareefalis/libvpx,GrokImageCompression/aom,pcwalton/libvpx,mbebenita/aom,pcwalton/libvpx,felipebetancur/libvpx,Suvarna1488/webm.libvpx,mwgoldsmith/libvpx,jdm/libvpx,Laknot/libvpx,openpeer/libvpx_new,kim42083/webm.libvpx,altogother/webm.libvpx,VTCSecureLLC/libvpx,iniwf/webm.libvpx,openpeer/libvpx_new,charup/https---github.com-webmproject-libvpx-,mbebenita/aom,zofuthan/libvpx,mwgoldsmith/libvpx,Laknot/libvpx,jdm/libvpx,ittiamvpx/libvpx-1,webmproject/libvpx,Maria1099/webm.libvpx,hsueceumd/test_hui,thdav/aom,ShiftMediaProject/libvpx,reimaginemedia/webm.libvpx,VTCSecureLLC/libvpx,mbebenita/aom,Maria1099/webm.libvpx,openpeer/libvpx_new,mbebenita/aom,smarter/aom,jdm/libvpx,goodleixiao/vpx,liqianggao/libvpx,lyx2014/libvpx_c,smarter/aom,Suvarna1488/webm.libvpx,shareefalis/libvpx,liqianggao/libvpx,pcwalton/libvpx,luctrudeau/aom,hsueceumd/test_hui,matanbs/vp982,thdav/aom,shareefalis/libvpx,openpeer/libvpx_new,jacklicn/webm.libvpx,Distrotech/libvpx,kalli123/webm.libvpx,luctrudeau/aom,mwgoldsmith/libvpx,stewnorriss/libvpx,stewnorriss/libvpx,hsueceumd/test_hui,jmvalin/aom,stewnorriss/libvpx,openpeer/libvpx_new,goodleixiao/vpx,Acidburn0zzz/webm.libvpx,ShiftMediaProject/libvpx,webmproject/libvpx,Topopiccione/libvpx,GrokImageCompression/aom,felipebetancur/libvpx,hsueceumd/test_hui,zofuthan/libvpx,Distrotech/libvpx,abwiz0086/webm.libvpx,zofuthan/libvpx,iniwf/webm.libvpx,abwiz0086/webm.libvpx,Topopiccione/libvpx,Maria1099/webm.libvpx,gshORTON/webm.libvpx,Suvarna1488/webm.libvpx,reimaginemedia/webm.libvpx,mwgoldsmith/vpx,abwiz0086/webm.libvpx,mbebenita/aom,jmvalin/aom,ittiamvpx/libvpx-1,stewnorriss/libvpx,shyamalschandra/libvpx,zofuthan/libvpx,Maria1099/webm.libvpx,Maria1099/webm.libvpx,smarter/aom,abwiz0086/webm.libvpx,mbebenita/aom,kleopatra999/webm.libvpx,shyamalschandra/libvpx,reimaginemedia/webm.libvpx,kalli123/webm.libvpx,felipebetancur/libvpx,hsueceumd/test_hui,luctrudeau/aom,thdav/aom,openpeer/libvpx_new,altogother/webm.libvpx,matanbs/webm.libvpx,kim42083/webm.libvpx,kleopatra999/webm.libvpx,jmvalin/aom,iniwf/webm.libvpx,matanbs/vp982,abwiz0086/webm.libvpx,gshORTON/webm.libvpx,shacklettbp/aom,VTCSecureLLC/libvpx,matanbs/webm.libvpx,mwgoldsmith/vpx,Suvarna1488/webm.libvpx,mwgoldsmith/vpx,matanbs/vp982,kalli123/webm.libvpx,matanbs/vp982,matanbs/webm.libvpx,kim42083/webm.libvpx,goodleixiao/vpx,Topopiccione/libvpx,jdm/libvpx,zofuthan/libvpx,liqianggao/libvpx,GrokImageCompression/aom,shacklettbp/aom,lyx2014/libvpx_c,matanbs/webm.libvpx,mwgoldsmith/libvpx,liqianggao/libvpx,mwgoldsmith/vpx,liqianggao/libvpx,GrokImageCompression/aom,GrokImageCompression/aom,shareefalis/libvpx,ShiftMediaProject/libvpx,matanbs/vp982,felipebetancur/libvpx,kim42083/webm.libvpx,matanbs/webm.libvpx,VTCSecureLLC/libvpx,ittiamvpx/libvpx-1,jmvalin/aom,Acidburn0zzz/webm.libvpx,jmvalin/aom,luctrudeau/aom,mwgoldsmith/vpx,liqianggao/libvpx,jacklicn/webm.libvpx,webmproject/libvpx,goodleixiao/vpx,gshORTON/webm.libvpx,jdm/libvpx,mbebenita/aom,Laknot/libvpx,kleopatra999/webm.libvpx,shareefalis/libvpx,shacklettbp/aom,Acidburn0zzz/webm.libvpx,kim42083/webm.libvpx,Acidburn0zzz/webm.libvpx,Distrotech/libvpx,matanbs/vp982,kleopatra999/webm.libvpx,running770/libvpx,smarter/aom,Maria1099/webm.libvpx,Topopiccione/libvpx,mwgoldsmith/vpx,thdav/aom,running770/libvpx,webmproject/libvpx,charup/https---github.com-webmproject-libvpx-,Distrotech/libvpx