Fixes hypothetical integer overflows Related to CID1135770 & CID1135771 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>