This is avoid that -1 overflows uint32_t. cherry-picked #c48106da from aom/master Change-Id: Ic3d99b1985cdb0a28cc83f8291422f5aba5a5a6d