summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-10-12 17:10:31 -0700
committerLajos Molnar <lajos@google.com>2015-10-12 17:27:17 -0700
commit77c185d5499d6174e7a97b3e1512994d3a803151 (patch)
treef5ad0fe15b5eac1f8eb5ca52384c022ac2e60b57 /include
parent0b1936bee532545381db6adf22f31ac437673f30 (diff)
downloadframeworks_av-77c185d5499d6174e7a97b3e1512994d3a803151.zip
frameworks_av-77c185d5499d6174e7a97b3e1512994d3a803151.tar.gz
frameworks_av-77c185d5499d6174e7a97b3e1512994d3a803151.tar.bz2
stagefright: check bounds for MediaCodecList.getCodecInfo
Bug: 24445127 Change-Id: I1c6cb9e2518b852d48d5d0d625b54409bd4e13ec
Diffstat (limited to 'include')
-rw-r--r--include/media/stagefright/MediaCodecList.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/media/stagefright/MediaCodecList.h b/include/media/stagefright/MediaCodecList.h
index 8605d99..67754f9 100644
--- a/include/media/stagefright/MediaCodecList.h
+++ b/include/media/stagefright/MediaCodecList.h
@@ -45,6 +45,10 @@ struct MediaCodecList : public BnMediaCodecList {
virtual size_t countCodecs() const;
virtual sp<MediaCodecInfo> getCodecInfo(size_t index) const {
+ if (index >= mCodecInfos.size()) {
+ ALOGE("b/24445127");
+ return NULL;
+ }
return mCodecInfos.itemAt(index);
}