[automerger skipped] Change range of SS-RSRQ per 3gpp am: 9ea18728f9 -s ours am: f3f1829dd1 -s ours

am skip reason: Change-Id I377ef00015876b706ffeb20d9255c1b1ebf66c15 with SHA-1 074d9041e0 is in history

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1362178

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8c289cdbce86cabf5074b4d43f22b6a2b340bb24
diff --git a/drm/1.0/default/CryptoPlugin.cpp b/drm/1.0/default/CryptoPlugin.cpp
index 2db3607..e6d4e84 100644
--- a/drm/1.0/default/CryptoPlugin.cpp
+++ b/drm/1.0/default/CryptoPlugin.cpp
@@ -124,7 +124,11 @@
             return Void();
         }
 
-        if (source.offset + offset + source.size > sourceBase->getSize()) {
+        size_t totalSize = 0;
+        if (__builtin_add_overflow(source.offset, offset, &totalSize) ||
+            __builtin_add_overflow(totalSize, source.size, &totalSize) ||
+            totalSize > sourceBase->getSize()) {
+            android_errorWriteLog(0x534e4554, "176496160");
             _hidl_cb(Status::ERROR_DRM_CANNOT_HANDLE, 0, "invalid buffer size");
             return Void();
         }