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
gugelfrei
George Burgess IV 5 years ago
parent 342d7bcf44
commit 61318c55b2

@ -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;

Loading…
Cancel
Save