Prevent integer overflow - Bug #19895