Fix for overflow exception

if x and y are both -1, the packed integer is 0xFFFFFFFF which is not a valid Int32, thus an overflow exception is thrown in IntPtr.ToInt32().