Fix overflows in dual prediction mode selection. Change-Id: I265ad46e01a307bca21e6223725e4055f5e08648