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

Commit 3cd77b1f authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4954419 from 0c6fa043 to pi-qpr1-release

Change-Id: I68dd3936c5631e09440369d7ede563b02a356342
parents 5fe99bad 0c6fa043
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -811,7 +811,13 @@ AMediaCodecCryptoInfo *AMediaCodecCryptoInfo_new(
        size_t *encryptedbytes) {

    // size needed to store all the crypto data
    size_t cryptosize = sizeof(AMediaCodecCryptoInfo) + sizeof(size_t) * numsubsamples * 2;
    size_t cryptosize;
    // = sizeof(AMediaCodecCryptoInfo) + sizeof(size_t) * numsubsamples * 2;
    if (__builtin_mul_overflow(sizeof(size_t) * 2, numsubsamples, &cryptosize) ||
            __builtin_add_overflow(cryptosize, sizeof(AMediaCodecCryptoInfo), &cryptosize)) {
        ALOGE("crypto size overflow");
        return NULL;
    }
    AMediaCodecCryptoInfo *ret = (AMediaCodecCryptoInfo*) malloc(cryptosize);
    if (!ret) {
        ALOGE("couldn't allocate %zu bytes", cryptosize);