Merge "hwc2: Add input validation and bound checks."