Commit 463e0fe5 authored by Dan Sanders's avatar Dan Sanders Committed by Commit Bot

[media] Initialize |impl_limit| correctly.

Bug: 780377
Change-Id: Ic1a486caf5978736bc71b99ea389ca324af097f8
Reviewed-on: https://chromium-review.googlesource.com/749314Reviewed-by: default avatarThomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Dan Sanders <sandersd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513313}
parent 085c83e1
...@@ -45,7 +45,8 @@ class MEDIA_EXPORT BufferReader { ...@@ -45,7 +45,8 @@ class MEDIA_EXPORT BufferReader {
bool HasBytes(size_t count) { bool HasBytes(size_t count) {
// As the size of a box is implementation limited to 2^31, fail if // As the size of a box is implementation limited to 2^31, fail if
// attempting to check for too many bytes. // attempting to check for too many bytes.
const size_t impl_limit = 1 << 31; const size_t impl_limit =
static_cast<size_t>(std::numeric_limits<int32_t>::max());
return pos_ <= buf_size_ && count <= impl_limit && return pos_ <= buf_size_ && count <= impl_limit &&
count <= buf_size_ - pos_; count <= buf_size_ - pos_;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment