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

Commit 538c310b authored by Andreas Huber's avatar Andreas Huber Committed by Android Git Automerger
Browse files

am 02a1f789: Merge "Limit the total amount of ID3 metadata to something...

am 02a1f789: Merge "Limit the total amount of ID3 metadata to something (un-)reasonable: 3MB." into froyo

Merge commit '02a1f789' into froyo-plus-aosp

* commit '02a1f789':
  Limit the total amount of ID3 metadata to something (un-)reasonable: 3MB.
parents d41d4586 02a1f789
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@

namespace android {

static const size_t kMaxMetadataSize = 3 * 1024 * 1024;

ID3::ID3(const sp<DataSource> &source)
    : mIsValid(false),
      mData(NULL),
@@ -111,6 +113,11 @@ bool ID3::parseV2(const sp<DataSource> &source) {
        size = (size << 7) | header.enc_size[i];
    }

    if (size > kMaxMetadataSize) {
        LOGE("skipping huge ID3 metadata of size %d", size);
        return false;
    }

    mData = (uint8_t *)malloc(size);

    if (mData == NULL) {