Skip to content

Commit

Permalink
Fix potential memory corruption in NuCachedSource2.
Browse files Browse the repository at this point in the history
Change-Id: Ia6bd2d4966287228a3ac1b067ee1f1ccad965dbb
related-to-bug: 4354845
  • Loading branch information
theandi666 committed May 4, 2011
1 parent d108538 commit 13aa6c2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions media/libstagefright/NuCachedSource2.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 13aa6c2

Please sign in to comment.