Index: src/unicode.h |
diff --git a/src/unicode.h b/src/unicode.h |
index 94ab1b4c1e7793cc1b0879e6906bb0b44851143c..91b16c9f3564f4f0fbb0846381ef02028b773f12 100644 |
--- a/src/unicode.h |
+++ b/src/unicode.h |
@@ -201,6 +201,7 @@ class CharacterStream { |
protected: |
virtual void FillBuffer() = 0; |
+ virtual bool BoundsCheck(unsigned offset) = 0; |
// The number of characters left in the current buffer |
unsigned remaining_; |
// The current offset within the buffer |
@@ -228,6 +229,9 @@ class InputBuffer : public CharacterStream { |
InputBuffer() { } |
explicit InputBuffer(Input input) { Reset(input); } |
virtual void FillBuffer(); |
+ virtual bool BoundsCheck(unsigned offset) { |
+ return (buffer_ != util_buffer_) || (offset < kSize); |
+ } |
// A custom offset that can be used by the string implementation to |
// mark progress within the encoded string. |