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

Commit cefe085c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "C2SoftVorbisDec: Fix memory leaks in multiple headers case" into rvc-qpr-dev

parents d907ae84 a15aa8d1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -279,6 +279,8 @@ void C2SoftVorbisDec::process(
        // skip 7 <type + "vorbis"> bytes
        makeBitReader((const uint8_t *)data + 7, inSize - 7, &buf, &ref, &bits);
        if (data[0] == 1) {
            // release any memory that vorbis_info_init will blindly overwrite
            vorbis_info_clear(mVi);
            vorbis_info_init(mVi);
            if (0 != _vorbis_unpack_info(mVi, &bits)) {
                ALOGE("Encountered error while unpacking info");
@@ -323,6 +325,8 @@ void C2SoftVorbisDec::process(
                work->result = C2_CORRUPTED;
                return;
            }
            // release any memory that vorbis_dsp_init will blindly overwrite
            vorbis_dsp_clear(mState);
            if (0 != vorbis_dsp_init(mState, mVi)) {
                ALOGE("Encountered error while dsp init");
                mSignalledError = true;