| commit | 522b797958daedb6ff6a2b21b1a8e0dd3ec5bf5e | [log] [tgz] |
|---|---|---|
| author | Ray Essick <essick@google.com> | Thu Feb 04 10:23:59 2021 -0800 |
| committer | Ray Essick <essick@google.com> | Thu Feb 04 10:23:59 2021 -0800 |
| tree | 749f1f150a210133a1c7ceac1a6bef84d61847e0 | |
| parent | 95a6374c968310142296d8431921f85487eedf83 [diff] |
Rephrase to avoid integer overflow Bug: 179046129 Test: atest sf_foundation_test w/local additions Change-Id: Ie86897fb6283b22745d2fc0cb9b9ea22736193a0
diff --git a/media/libstagefright/foundation/ABuffer.cpp b/media/libstagefright/foundation/ABuffer.cpp index c8965d9..c79384c 100644 --- a/media/libstagefright/foundation/ABuffer.cpp +++ b/media/libstagefright/foundation/ABuffer.cpp
@@ -67,7 +67,7 @@ void ABuffer::setRange(size_t offset, size_t size) { CHECK_LE(offset, mCapacity); - CHECK_LE(offset + size, mCapacity); + CHECK_LE(size, mCapacity - offset); mRangeOffset = offset; mRangeLength = size;