summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJoshua J. Drake <android-open-source@qoop.org>2015-04-08 23:44:57 -0500
committerNick Kralevich <nnk@google.com>2015-08-03 16:22:53 -0700
commit5c4428f6391478ae983e1fcf7c42c832aa1a5e69 (patch)
tree6aeee1c3b1a0ca4a4447c6b3244d33362a76f811 /media
parent3cc11bfc00cbb3ed87a4464777a75606b4973b51 (diff)
downloadframeworks_av-5c4428f6391478ae983e1fcf7c42c832aa1a5e69.zip
frameworks_av-5c4428f6391478ae983e1fcf7c42c832aa1a5e69.tar.gz
frameworks_av-5c4428f6391478ae983e1fcf7c42c832aa1a5e69.tar.bz2
Fix integer overflow during MP4 atom processing
A few sample table related FourCC values are handled by the setSampleToChunkParams function. An integer overflow exists within this function. Validate that mNumSampleToChunkOffets will not cause an integer overflow. Bug: 20139950 Change-Id: I1972cc185fce5e058afa143ad5eabcc269ad324d (cherry picked from commit c24607c29c96f939aed9e33bfa702b1dd79da4b7)
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/SampleTable.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/media/libstagefright/SampleTable.cpp b/media/libstagefright/SampleTable.cpp
index 1358582..a7ceecb 100644
--- a/media/libstagefright/SampleTable.cpp
+++ b/media/libstagefright/SampleTable.cpp
@@ -230,6 +230,9 @@ status_t SampleTable::setSampleToChunkParams(
return ERROR_MALFORMED;
}
+ if (SIZE_MAX / sizeof(SampleToChunkEntry) <= mNumSampleToChunkOffsets)
+ return ERROR_OUT_OF_RANGE;
+
mSampleToChunkEntries =
new SampleToChunkEntry[mNumSampleToChunkOffsets];