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

Commit 190dfbdb authored by Marco Nelissen's avatar Marco Nelissen Committed by Android (Google) Code Review
Browse files

Merge "Fix Ogg album art" into mnc-dev

parents aa7a4eae c63cc509
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1299,11 +1299,12 @@ static void extractAlbumArt(
    }

    typeLen = U32_AT(&flac[4]);
    if (typeLen + 1 > sizeof(type)) {
    if (typeLen > sizeof(type) - 1) {
        goto exit;
    }

    if (flacSize < 8 + typeLen) {
    // we've already checked above that flacSize >= 8
    if (flacSize - 8 < typeLen) {
        goto exit;
    }

@@ -1319,13 +1320,17 @@ static void extractAlbumArt(

    descLen = U32_AT(&flac[8 + typeLen]);

    if (flacSize < 32 + typeLen + descLen) {
    if (flacSize < 32 ||
        flacSize - 32 < typeLen ||
        flacSize - 32 - typeLen < descLen) {
        goto exit;
    }

    dataLen = U32_AT(&flac[8 + typeLen + 4 + descLen + 16]);

    if (flacSize < 32 + typeLen + descLen + dataLen) {

    // we've already checked above that (flacSize - 32 - typeLen - descLen) >= 0
    if (flacSize - 32 - typeLen - descLen < dataLen) {
        goto exit;
    }