Fix signed/unsigned mismatch on Windows.

Issue #168
This commit is contained in:
Haoming Chen 2017-01-06 14:57:48 -08:00 committed by Kongqun Yang
parent 93fe5457bf
commit 15dacf6288
3 changed files with 4 additions and 4 deletions

View File

@ -525,7 +525,7 @@ bool VP9Parser::Parse(const uint8_t* data,
<< "\n header_size: " << header_size; << "\n header_size: " << header_size;
RCHECK(header_size > 0); RCHECK(header_size > 0);
RCHECK(header_size * 8 <= reader.bits_available()); RCHECK(header_size * 8u <= reader.bits_available());
data += vpx_frame.frame_size; data += vpx_frame.frame_size;
} }

View File

@ -104,7 +104,7 @@ bool VPCodecConfigurationRecord::ParseMP4(const std::vector<uint8_t>& data) {
RCHECK(reader.ReadBits(1, &video_full_range_flag_)); RCHECK(reader.ReadBits(1, &video_full_range_flag_));
uint16_t codec_initialization_data_size = 0; uint16_t codec_initialization_data_size = 0;
RCHECK(reader.ReadBits(16, &codec_initialization_data_size)); RCHECK(reader.ReadBits(16, &codec_initialization_data_size));
RCHECK(reader.bits_available() >= codec_initialization_data_size * 8); RCHECK(reader.bits_available() >= codec_initialization_data_size * 8u);
const size_t header_size = data.size() - reader.bits_available() / 8; const size_t header_size = data.size() - reader.bits_available() / 8;
codec_initialization_data_.assign( codec_initialization_data_.assign(
data.begin() + header_size, data.begin() + header_size,

View File

@ -208,7 +208,7 @@ bool WvmMediaParser::Parse(const uint8_t* buf, int size) {
parse_state_ = SystemHeaderSkip; parse_state_ = SystemHeaderSkip;
break; break;
case PackHeaderStuffingSkip: case PackHeaderStuffingSkip:
if ((end - read_ptr) >= skip_bytes_) { if (end >= skip_bytes_ + read_ptr) {
read_ptr += skip_bytes_; read_ptr += skip_bytes_;
skip_bytes_ = 0; skip_bytes_ = 0;
parse_state_ = StartCode1; parse_state_ = StartCode1;
@ -218,7 +218,7 @@ bool WvmMediaParser::Parse(const uint8_t* buf, int size) {
} }
continue; continue;
case SystemHeaderSkip: case SystemHeaderSkip:
if ((end - read_ptr) >= skip_bytes_) { if (end >= skip_bytes_ + read_ptr) {
read_ptr += skip_bytes_; read_ptr += skip_bytes_;
skip_bytes_ = 0; skip_bytes_ = 0;
parse_state_ = StartCode1; parse_state_ = StartCode1;