diff options
author | Jessica Wagantall <jwagantall@cyngn.com> | 2016-05-03 11:49:19 -0700 |
---|---|---|
committer | Jessica Wagantall <jwagantall@cyngn.com> | 2016-05-03 11:59:43 -0700 |
commit | bcd1d7c5905d66aa682c4b5a9dfe59189aeecabd (patch) | |
tree | 97ad067703481a8201a4920b6995e670be4c597e /media/libmediaplayerservice | |
parent | 7592f6cde9d6a228e07377fc822adab0cad0faf7 (diff) | |
parent | daa85dac2055b22dabbb3b4e537597e6ab73a866 (diff) | |
download | frameworks_av-bcd1d7c5905d66aa682c4b5a9dfe59189aeecabd.zip frameworks_av-bcd1d7c5905d66aa682c4b5a9dfe59189aeecabd.tar.gz frameworks_av-bcd1d7c5905d66aa682c4b5a9dfe59189aeecabd.tar.bz2 |
Merge tag 'android-6.0.1_r43' into HEAD
Ticket: CYNGNOS-2373
Android 6.0.1 release 43 (MOB30J)
Change-Id: Ie0ab546349bd8a7eed51c839fba28b809e433fd4
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerStreamListener.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerStreamListener.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerStreamListener.cpp index f53afbd..ee70306 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerStreamListener.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerStreamListener.cpp @@ -144,8 +144,17 @@ ssize_t NuPlayer::NuPlayerStreamListener::read( copy = size; } + if (entry->mIndex >= mBuffers.size()) { + return ERROR_MALFORMED; + } + + sp<IMemory> mem = mBuffers.editItemAt(entry->mIndex); + if (mem == NULL || mem->size() < copy || mem->size() - copy < entry->mOffset) { + return ERROR_MALFORMED; + } + memcpy(data, - (const uint8_t *)mBuffers.editItemAt(entry->mIndex)->pointer() + (const uint8_t *)mem->pointer() + entry->mOffset, copy); |