diff options
author | Leena Winterrowd <lenhardw@codeaurora.org> | 2014-11-03 18:56:39 -0800 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2015-01-28 21:52:09 -0800 |
commit | 5cf91c5067a9c7ed3c138d4e56fb176b28f5dc3a (patch) | |
tree | 475dcb263d0e2ab0fca6c2310e521269806db3d9 /media/libstagefright/httplive | |
parent | f0d689934e70d3e5b3784265e890377db04c7c1d (diff) | |
download | frameworks_av-5cf91c5067a9c7ed3c138d4e56fb176b28f5dc3a.zip frameworks_av-5cf91c5067a9c7ed3c138d4e56fb176b28f5dc3a.tar.gz frameworks_av-5cf91c5067a9c7ed3c138d4e56fb176b28f5dc3a.tar.bz2 |
libstagefright: httplive: Add NULL check for empty playlist
If the source playlist is empty, the playlist meta will be NULL.
Check for this case to avoid an invalid dereference. Also flag
playlists without the required EXT-X-TARGETDURATION tag as malformed.
Bug: 18821145
Change-Id: Idf74d890a89bbc6483a6d4060eb092dc7461be24
Diffstat (limited to 'media/libstagefright/httplive')
-rw-r--r-- | media/libstagefright/httplive/PlaylistFetcher.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp index d8eed5b..2cfdfe4 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.cpp +++ b/media/libstagefright/httplive/PlaylistFetcher.cpp @@ -610,7 +610,12 @@ void PlaylistFetcher::onMonitorQueue() { int32_t targetDurationSecs; int64_t targetDurationUs = kMinBufferedDurationUs; if (mPlaylist != NULL) { - CHECK(mPlaylist->meta()->findInt32("target-duration", &targetDurationSecs)); + if (mPlaylist->meta() == NULL || !mPlaylist->meta()->findInt32( + "target-duration", &targetDurationSecs)) { + ALOGE("Playlist is missing required EXT-X-TARGETDURATION tag"); + notifyError(ERROR_MALFORMED); + return; + } targetDurationUs = targetDurationSecs * 1000000ll; } |