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

Commit fe7186bb authored by Marco Nelissen's avatar Marco Nelissen
Browse files

OggExtractor::verifyHeader: return errors instead of asserting

Bug: 16631522
Change-Id: I619455af64cad04a0f4fd35e52e3f3709efad8b4
parent a627e3df
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -753,7 +753,9 @@ status_t MyVorbisExtractor::verifyHeader(
    oggpack_buffer bits;
    oggpack_readinit(&bits, &ref);

    CHECK_EQ(oggpack_read(&bits, 8), type);
    if (oggpack_read(&bits, 8) != type) {
        return ERROR_MALFORMED;
    }
    for (size_t i = 0; i < 6; ++i) {
        oggpack_read(&bits, 8);  // skip 'vorbis'
    }
@@ -761,7 +763,9 @@ status_t MyVorbisExtractor::verifyHeader(
    switch (type) {
        case 1:
        {
            CHECK_EQ(0, _vorbis_unpack_info(&mVi, &bits));
            if (0 != _vorbis_unpack_info(&mVi, &bits)) {
                return ERROR_MALFORMED;
            }

            mMeta->setData(kKeyVorbisInfo, 0, data, size);
            mMeta->setInt32(kKeySampleRate, mVi.rate);