OSDN Git Service

stagefright: check bounds for MediaCodecList.getCodecInfo
authorLajos Molnar <lajos@google.com>
Tue, 13 Oct 2015 00:10:31 +0000 (17:10 -0700)
committerLajos Molnar <lajos@google.com>
Tue, 13 Oct 2015 00:27:17 +0000 (17:27 -0700)
Bug: 24445127
Change-Id: I1c6cb9e2518b852d48d5d0d625b54409bd4e13ec

include/media/stagefright/MediaCodecList.h

index 8605d99..67754f9 100644 (file)
@@ -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);
     }