Loading include/media/stagefright/foundation/AUtils.h +2 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ void ENSURE_UNSIGNED_TYPE() { // needle is in range [hayStart, hayStart + haySize) template<class T, class U> __attribute__((no_sanitize("integer"))) inline static bool isInRange(const T &hayStart, const U &haySize, const T &needle) { ENSURE_UNSIGNED_TYPE<U>(); return (T)(hayStart + haySize) >= hayStart && needle >= hayStart && (U)(needle - hayStart) < haySize; Loading @@ -75,6 +76,7 @@ inline static bool isInRange(const T &hayStart, const U &haySize, const T &needl // [needleStart, needleStart + needleSize) is in range [hayStart, hayStart + haySize) template<class T, class U> __attribute__((no_sanitize("integer"))) inline static bool isInRange( const T &hayStart, const U &haySize, const T &needleStart, const U &needleSize) { ENSURE_UNSIGNED_TYPE<U>(); Loading Loading
include/media/stagefright/foundation/AUtils.h +2 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ void ENSURE_UNSIGNED_TYPE() { // needle is in range [hayStart, hayStart + haySize) template<class T, class U> __attribute__((no_sanitize("integer"))) inline static bool isInRange(const T &hayStart, const U &haySize, const T &needle) { ENSURE_UNSIGNED_TYPE<U>(); return (T)(hayStart + haySize) >= hayStart && needle >= hayStart && (U)(needle - hayStart) < haySize; Loading @@ -75,6 +76,7 @@ inline static bool isInRange(const T &hayStart, const U &haySize, const T &needl // [needleStart, needleStart + needleSize) is in range [hayStart, hayStart + haySize) template<class T, class U> __attribute__((no_sanitize("integer"))) inline static bool isInRange( const T &hayStart, const U &haySize, const T &needleStart, const U &needleSize) { ENSURE_UNSIGNED_TYPE<U>(); Loading