diff options
author | Andreas Huber <andih@google.com> | 2011-05-04 11:43:43 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2011-05-04 11:43:43 -0700 |
commit | 67802977b6f0aa8d6f14f85dadcf32a3cadb9c07 (patch) | |
tree | ffa2df57c4ddd67c64244c78e214de97304e48a4 /media | |
parent | 89dc0dffdcbf0999a854a9b1bbea8f56395cc209 (diff) | |
download | frameworks_av-67802977b6f0aa8d6f14f85dadcf32a3cadb9c07.zip frameworks_av-67802977b6f0aa8d6f14f85dadcf32a3cadb9c07.tar.gz frameworks_av-67802977b6f0aa8d6f14f85dadcf32a3cadb9c07.tar.bz2 |
Fix potential memory corruption in NuCachedSource2.
Change-Id: Ia6bd2d4966287228a3ac1b067ee1f1ccad965dbb
related-to-bug: 4354845
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/NuCachedSource2.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/media/libstagefright/NuCachedSource2.cpp b/media/libstagefright/NuCachedSource2.cpp index dc86885..81f2e47 100644 --- a/media/libstagefright/NuCachedSource2.cpp +++ b/media/libstagefright/NuCachedSource2.cpp @@ -450,6 +450,11 @@ ssize_t NuCachedSource2::readInternal(off64_t offset, void *data, size_t size) { } size_t avail = mCache->totalSize() - delta; + + if (avail > size) { + avail = size; + } + mCache->copy(delta, data, avail); return avail; |