diff options
author | Chad Brubaker <cbrubaker@google.com> | 2015-08-11 15:21:02 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-11-05 21:16:18 -0800 |
commit | 41cd3f51d445ea4e5f9984910e6eb95cdec1438a (patch) | |
tree | 51f882b29c028f9accb890e63447251fbb88b3c7 | |
parent | 86ea14b97299e54addac4e5227b05c67a129be57 (diff) | |
download | frameworks_av-41cd3f51d445ea4e5f9984910e6eb95cdec1438a.zip frameworks_av-41cd3f51d445ea4e5f9984910e6eb95cdec1438a.tar.gz frameworks_av-41cd3f51d445ea4e5f9984910e6eb95cdec1438a.tar.bz2 |
Fix benign unsigned integer overflow
Bug:23110888
Change-Id: Ibd6f1c7a9204cf584536c1ee63f6a8e5c6e4aa59
(cherry picked from commit 69c1e038717d3462ea5991425ba009f0aed148d2)
-rw-r--r-- | media/libstagefright/DataURISource.cpp | 3 | ||||
-rw-r--r-- | media/libstagefright/OMXCodec.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/media/libstagefright/DataURISource.cpp b/media/libstagefright/DataURISource.cpp index 2c39314..2a61c3a 100644 --- a/media/libstagefright/DataURISource.cpp +++ b/media/libstagefright/DataURISource.cpp @@ -42,7 +42,8 @@ sp<DataURISource> DataURISource::Create(const char *uri) { AString encoded(commaPos + 1); // Strip CR and LF... - for (size_t i = encoded.size(); i-- > 0;) { + for (size_t i = encoded.size(); i > 0;) { + i--; if (encoded.c_str()[i] == '\r' || encoded.c_str()[i] == '\n') { encoded.erase(i, 1); } diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 8d0bccd..194edd5 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -2689,7 +2689,8 @@ status_t OMXCodec::freeBuffersOnPort( status_t stickyErr = OK; - for (size_t i = buffers->size(); i-- > 0;) { + for (size_t i = buffers->size(); i > 0;) { + i--; BufferInfo *info = &buffers->editItemAt(i); if (onlyThoseWeOwn && info->mStatus == OWNED_BY_COMPONENT) { |