diff options
author | 2016-02-08 09:35:05 -0800 | |
---|---|---|
committer | 2016-02-08 09:35:05 -0800 | |
commit | 6fd4e44e238755f8f81d007c8281c8fd63f03b3b (patch) | |
tree | b423cfd590ca6496e74af0ef0ba8ffdd7b753175 /gyp | |
parent | e365bfa1e7944a15505e7c00df71551e66204ac4 (diff) |
msan: define BREAK_IF_DEBUGGING_AND_OUT_OF_RANGE in piex
This should assert(false) if we're in the error case of RangeCheckedBytePtr::extractBytes:
> #ifdef BREAK_IF_DEBUGGING_AND_OUT_OF_RANGE
> #define BREAK_IF_DEBUGGING() assert(false)
> #else
> #define BREAK_IF_DEBUGGING() assert(true)
> #endif
...
> std::vector<unsigned char> RangeCheckedBytePtr::extractBytes(size_t pos, size_t length) const {
> std::vector<unsigned char> result;
> if (pos + length < pos /* overflow */ || remainingLength() < pos + length) {
> BREAK_IF_DEBUGGING();
> error_flag_ = RANGE_CHECKED_BYTE_ERROR_OVERFLOW;
> return result;
> }
...
BUG=skia:4903
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1678913002
Review URL: https://codereview.chromium.org/1678913002
Diffstat (limited to 'gyp')
-rw-r--r-- | gyp/piex.gyp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gyp/piex.gyp b/gyp/piex.gyp index b2a1f36ce8..630ccfe05d 100644 --- a/gyp/piex.gyp +++ b/gyp/piex.gyp @@ -35,6 +35,7 @@ '../third_party/externals/piex/src/tiff_directory/tiff_directory.cc', '../third_party/externals/piex/src/tiff_parser.cc', ], + 'defines': [ 'BREAK_IF_DEBUGGING_AND_OUT_OF_RANGE' ], 'include_dirs': [ '../third_party/externals/piex' ], 'direct_dependent_settings': { 'include_dirs': [ '../third_party/externals/piex' ], |