Ensure the values are spec complaint and that no integer overflow can happen. Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit 9ce065c90d)
9ce065c90d