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
diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.cpp b/media/libmediaplayerservice/nuplayer/GenericSource.cpp
index e26f1e6..74cb266 100644
--- a/media/libmediaplayerservice/nuplayer/GenericSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/GenericSource.cpp
@@ -782,7 +782,7 @@
return;
}
- int64_t nextSubTimeUs;
+ int64_t nextSubTimeUs = 0;
readBuffer(type, -1, MediaPlayerSeekMode::SEEK_PREVIOUS_SYNC /* mode */, &nextSubTimeUs);
sp<ABuffer> buffer;