summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-05-04 11:50:48 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-05-04 11:50:48 -0700
commit87ae62f327eb155a595ab6400e924667fd50a852 (patch)
tree26b259e6c7be68626372782b48ac15a168ff75f6 /media/libstagefright
parent82ac8bf2da940c4439786c346f739f4a496864ad (diff)
parent67802977b6f0aa8d6f14f85dadcf32a3cadb9c07 (diff)
downloadframeworks_av-87ae62f327eb155a595ab6400e924667fd50a852.zip
frameworks_av-87ae62f327eb155a595ab6400e924667fd50a852.tar.gz
frameworks_av-87ae62f327eb155a595ab6400e924667fd50a852.tar.bz2
Merge "Fix potential memory corruption in NuCachedSource2."
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/NuCachedSource2.cpp5
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;