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

Commit 61318c55 authored by George Burgess IV's avatar George Burgess IV
Browse files

nuplayer: fix a use-of-uninit-value

`readBuffer` might not set `nextSubTimeUs`. It's not clear that
`mMediaClock->addTimer(msg, nextSubTimeUs);` is only called in cases
where `nextSubTimeUs` is set, so initialize it to 0 here.

This is consistent with what's done in `fetchTextData`.

Caught by the static analyzer:

frameworks/av/media/libmediaplayerservice/nuplayer/GenericSource.cpp:799:9:
warning: 2nd function call argument is an uninitialized value
[clang-analyzer-core.CallAndMessage]

Bug: None
Test: TreeHugger
Change-Id: Iae6f9d71757c1bcc6e994a448b6169b4d69c4a38
parent 342d7bcf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -782,7 +782,7 @@ void NuPlayer::GenericSource::sendTextData(
        return;
    }

    int64_t nextSubTimeUs;
    int64_t nextSubTimeUs = 0;
    readBuffer(type, -1, MediaPlayerSeekMode::SEEK_PREVIOUS_SYNC /* mode */, &nextSubTimeUs);

    sp<ABuffer> buffer;