Snap for 7122685 from 2b094e710e to sc-release

Change-Id: I35a1570762eb364d93e5f489d0c5ee58d052a498
This commit is contained in:
android-build-team Robot
2021-02-04 03:00:37 +00:00

View File

@@ -199,7 +199,11 @@ Return<void> WVCryptoPlugin::decrypt_1_2(
return Void();
}
if (source.offset + offset + source.size > sourceBase->getSize()) {
size_t totalSrcSize = 0;
if (__builtin_add_overflow(source.offset, offset, &totalSrcSize) ||
__builtin_add_overflow(totalSrcSize, source.size, &totalSrcSize) ||
totalSrcSize > sourceBase->getSize()) {
android_errorWriteLog(0x534e4554, "176496160");
_hidl_cb(Status_V1_2::ERROR_DRM_CANNOT_HANDLE, 0, "invalid buffer size");
return Void();
}