Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2987dfb authored by Edwin Wong's avatar Edwin Wong Committed by Automerger Merge Worker
Browse files

Fix potential decrypt src pointer overflow. am: 9bae1251 am: c732dd92 am:...

Fix potential decrypt src pointer overflow. am: 9bae1251 am: c732dd92 am: 9078b155 am: cb8e3038 am: dfae8ae8

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If43ca3d1fbef98ea0c223cd5d7e04d3e18e015b0
parents 1570f85e dfae8ae8
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -119,7 +119,11 @@ Return<void> CryptoPlugin::decrypt_1_2(
        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_V1_2::ERROR_DRM_CANNOT_HANDLE, 0, "invalid buffer size");
        return Void();
    }