Chromium Code Reviews| Index: media/formats/mp4/box_reader.h |
| diff --git a/media/formats/mp4/box_reader.h b/media/formats/mp4/box_reader.h |
| index d4b608e78f9ea80c76f0dc6c95d20005d9b5c7ce..1ba0294bff3728799749fd862015053ee4b0e0ca 100644 |
| --- a/media/formats/mp4/box_reader.h |
| +++ b/media/formats/mp4/box_reader.h |
| @@ -29,7 +29,10 @@ struct MEDIA_EXPORT Box { |
| class MEDIA_EXPORT BufferReader { |
| public: |
| BufferReader(const uint8* buf, const int size) |
| - : buf_(buf), size_(size), pos_(0) {} |
| + : buf_(buf), size_(size), pos_(0) { |
| + CHECK(buf); |
|
scherkus (not reviewing)
2014/05/05 18:22:17
did you mean to add these?, or are these leftover
acolwell GONE FROM CHROMIUM
2014/05/05 18:49:02
Yes. This is intended to protect release code from
|
| + CHECK_GE(size, 0); |
| + } |
| bool HasBytes(int count) { return (pos() + count <= size()); } |