diff options
author | Marco Nelissen <marcone@google.com> | 2015-10-06 14:30:56 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-11-05 21:16:18 -0800 |
commit | 86ea14b97299e54addac4e5227b05c67a129be57 (patch) | |
tree | d9d874f869d1c5718aa3cd34de3ca9502f7dd0ad | |
parent | f75aa259959c64e8b4eeb4a25528b1580b348a2f (diff) | |
download | frameworks_av-86ea14b97299e54addac4e5227b05c67a129be57.zip frameworks_av-86ea14b97299e54addac4e5227b05c67a129be57.tar.gz frameworks_av-86ea14b97299e54addac4e5227b05c67a129be57.tar.bz2 |
Fix benign overflows in ACodec
Change-Id: Ia699f8a9f5367a9b38aaa6bbbdb0097c3e2ab551
-rw-r--r-- | media/libstagefright/ACodec.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index a81bca5..00a1e29 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -1336,7 +1336,8 @@ ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() { } bool stale = false; - for (size_t i = mBuffers[kPortIndexOutput].size(); i-- > 0;) { + for (size_t i = mBuffers[kPortIndexOutput].size(); i > 0;) { + i--; BufferInfo *info = &mBuffers[kPortIndexOutput].editItemAt(i); if (info->mGraphicBuffer != NULL && @@ -1379,7 +1380,8 @@ ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() { // get oldest undequeued buffer BufferInfo *oldest = NULL; - for (size_t i = mBuffers[kPortIndexOutput].size(); i-- > 0;) { + for (size_t i = mBuffers[kPortIndexOutput].size(); i > 0;) { + i--; BufferInfo *info = &mBuffers[kPortIndexOutput].editItemAt(i); if (info->mStatus == BufferInfo::OWNED_BY_NATIVE_WINDOW && |