diff --git a/packager/media/codecs/vp9_parser.cc b/packager/media/codecs/vp9_parser.cc index 6203ae8e13..1ab53811fe 100644 --- a/packager/media/codecs/vp9_parser.cc +++ b/packager/media/codecs/vp9_parser.cc @@ -525,7 +525,7 @@ bool VP9Parser::Parse(const uint8_t* data, << "\n header_size: " << header_size; RCHECK(header_size > 0); - RCHECK(header_size * 8 <= reader.bits_available()); + RCHECK(header_size * 8u <= reader.bits_available()); data += vpx_frame.frame_size; } diff --git a/packager/media/codecs/vp_codec_configuration_record.cc b/packager/media/codecs/vp_codec_configuration_record.cc index 6afd43e61f..2709c5054e 100644 --- a/packager/media/codecs/vp_codec_configuration_record.cc +++ b/packager/media/codecs/vp_codec_configuration_record.cc @@ -104,7 +104,7 @@ bool VPCodecConfigurationRecord::ParseMP4(const std::vector& data) { RCHECK(reader.ReadBits(1, &video_full_range_flag_)); uint16_t codec_initialization_data_size = 0; 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; codec_initialization_data_.assign( data.begin() + header_size, diff --git a/packager/media/formats/wvm/wvm_media_parser.cc b/packager/media/formats/wvm/wvm_media_parser.cc index 654e821f1e..19206a87a3 100644 --- a/packager/media/formats/wvm/wvm_media_parser.cc +++ b/packager/media/formats/wvm/wvm_media_parser.cc @@ -208,7 +208,7 @@ bool WvmMediaParser::Parse(const uint8_t* buf, int size) { parse_state_ = SystemHeaderSkip; break; case PackHeaderStuffingSkip: - if ((end - read_ptr) >= skip_bytes_) { + if (end >= skip_bytes_ + read_ptr) { read_ptr += skip_bytes_; skip_bytes_ = 0; parse_state_ = StartCode1; @@ -218,7 +218,7 @@ bool WvmMediaParser::Parse(const uint8_t* buf, int size) { } continue; case SystemHeaderSkip: - if ((end - read_ptr) >= skip_bytes_) { + if (end >= skip_bytes_ + read_ptr) { read_ptr += skip_bytes_; skip_bytes_ = 0; parse_state_ = StartCode1;