Layer: Guard against Region offset overflows am: 33da946835

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/18887801

Change-Id: Ica68be56b3a678e35010dd4a27704464dd69094e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>