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

Commit 2d9f3169 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 5595 into donut

* changes:
  We might try to close the Vorbis file twice under certain circumstances. This fix nulls the mFile member so we don't try to close it twice. Bug 1904783.
parents fbd8f69a 97881196
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -345,9 +345,6 @@ status_t VorbisPlayer::reset()
{
    LOGV("reset\n");
    Mutex::Autolock l(mMutex);
    if (mState != STATE_OPEN) {
        return NO_ERROR;
    }
    return reset_nosync();
}

@@ -355,10 +352,13 @@ status_t VorbisPlayer::reset()
status_t VorbisPlayer::reset_nosync()
{
    // close file
    if (mFile != NULL) {
        ov_clear(&mVorbisFile); // this also closes the FILE
        if (mFile != NULL) {
            LOGV("OOPS! Vorbis didn't close the file");
            fclose(mFile);
            mFile = NULL;
        }
    }
    mState = STATE_ERROR;