status_t NuPlayer::GenericSource::dequeueAccessUnit(
 bool audio, sp<ABuffer> *accessUnit) {
 Track *track = audio ? &mAudioTrack : &mVideoTrack;

 if (track->mSource == NULL) {
 return -EWOULDBLOCK;
 }

 if (mIsWidevine && !audio) {
        postReadBuffer(MEDIA_TRACK_TYPE_VIDEO);
 }

 status_t finalResult;
 if (!track->mPackets->hasBufferAvailable(&finalResult)) {
 return (finalResult == OK ? -EWOULDBLOCK : finalResult);
 }

 status_t result = track->mPackets->dequeueAccessUnit(accessUnit);

 if (!track->mPackets->hasBufferAvailable(&finalResult)) {
        postReadBuffer(audio? MEDIA_TRACK_TYPE_AUDIO : MEDIA_TRACK_TYPE_VIDEO);
 }

 if (result != OK) {
 if (mSubtitleTrack.mSource != NULL) {
            mSubtitleTrack.mPackets->clear();
            mFetchSubtitleDataGeneration++;
 }
 if (mTimedTextTrack.mSource != NULL) {
            mTimedTextTrack.mPackets->clear();
            mFetchTimedTextDataGeneration++;
 }
 return result;
 }

 int64_t timeUs;
 status_t eosResult; // ignored
    CHECK((*accessUnit)->meta()->findInt64("timeUs", &timeUs));

 if (mSubtitleTrack.mSource != NULL
 && !mSubtitleTrack.mPackets->hasBufferAvailable(&eosResult)) {
        sp<AMessage> msg = new AMessage(kWhatFetchSubtitleData, id());
        msg->setInt64("timeUs", timeUs);
        msg->setInt32("generation", mFetchSubtitleDataGeneration);
        msg->post();
 }

 if (mTimedTextTrack.mSource != NULL
 && !mTimedTextTrack.mPackets->hasBufferAvailable(&eosResult)) {
        sp<AMessage> msg = new AMessage(kWhatFetchTimedTextData, id());
        msg->setInt64("timeUs", timeUs);
        msg->setInt32("generation", mFetchTimedTextDataGeneration);
        msg->post();
 }

 return result;
}

The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.