commit | 929c486b9c33e7c533c363e408614e7083c17156 | [log] [tgz] |
---|---|---|
author | Marco Nelissen <marcone@google.com> | Tue Nov 10 09:06:02 2015 -0800 |
committer | Marco Nelissen <marcone@google.com> | Tue Nov 10 09:06:02 2015 -0800 |
tree | 4313ed5cbca819496d3eb2a08c186c2bbc897470 | |
parent | 51cd9a441ed0acf6e3b9c221e9b7f9424073191f [diff] |
Fix overflow check so it doesn't reject legitimate files Change-Id: Id2a25af287f2d06755ebdf133fcea166a6767a27
diff --git a/media/libstagefright/SampleTable.cpp b/media/libstagefright/SampleTable.cpp index 02b20c4..93cf055 100644 --- a/media/libstagefright/SampleTable.cpp +++ b/media/libstagefright/SampleTable.cpp
@@ -246,7 +246,7 @@ for (uint32_t i = 0; i < mNumSampleToChunkOffsets; ++i) { uint8_t buffer[12]; - if ((off64_t)((SIZE_MAX / 12) - 8 - i) < mSampleToChunkOffset) { + if ((off64_t)(SIZE_MAX - 8 - (i * 12)) < mSampleToChunkOffset) { return ERROR_MALFORMED; }