This ports a change from libvpx to fix ubsan warnings. Change-Id: I43e8d52c3df7b4f7b4e59f13dc9d0a5a0176f419