Layer: Guard against Region offset overflows am: 33da946835 am: f293ef1939

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

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