Chromium Code Reviews| Index: src/core/SkValidatingReadBuffer.cpp |
| diff --git a/src/core/SkValidatingReadBuffer.cpp b/src/core/SkValidatingReadBuffer.cpp |
| index b8247ab566744f95bdf0643d17084bd8bd7064b2..e10b2d5a1d8ac559617a90aaf234c44cc1a19cb6 100644 |
| --- a/src/core/SkValidatingReadBuffer.cpp |
| +++ b/src/core/SkValidatingReadBuffer.cpp |
| @@ -92,6 +92,10 @@ const void* SkValidatingReadBuffer::skip(size_t size) { |
| } |
| bool SkValidatingReadBuffer::readBool() { |
| + const void* addr = fReader.peek(); |
| + const uint32_t* boolPtr = static_cast<const uint32_t*>(addr); |
| + // Boolean value should be either 0 or 1 |
| + fError |= !boolPtr || (*boolPtr) & 0xFFFFFFFE; |
|
reed1
2013/09/13 15:42:56
Why are we dealing with ptrs and casts here? Why n
sugoi1
2013/09/13 16:53:44
You're right, I was originally thinking of a more
|
| return this->readInt() != 0; |
| } |