diff options
author | James Zern <jzern@google.com> | 2022-10-21 12:18:53 -0700 |
---|---|---|
committer | James Zern <jzern@google.com> | 2022-10-21 12:32:14 -0700 |
commit | b919a8f55da076b8d5022023cd6ef90d5e525553 (patch) | |
tree | a70d09ea26d8bea7d60382340eeceacde77a1e75 | |
parent | ee0bab576c338c9807249b99588e352b7268cb62 (diff) | |
download | libwebm-b919a8f55da076b8d5022023cd6ef90d5e525553.tar.gz |
clear implicit conversion warnings
reported by clang-11 -fsanitize=integer
mkvparser/mkvparser.cc:301:31: runtime error: implicit conversion from
type 'signed char' of value -128 (8-bit, signed) to type 'unsigned long
long' changed the value to 18446744073709551488 (64-bit, unsigned)
m2ts/webm2pes.cc:71:13: runtime error: implicit conversion from type
'unsigned int' of value 1260 (32-bit, unsigned) to type 'std::uint8_t'
(aka 'unsigned char') changed the value to 236 (8-bit, unsigned)
Change-Id: If3d6f17edb7a0d79a944a4dd0919878cf524460b
-rw-r--r-- | m2ts/webm2pes.cc | 2 | ||||
-rw-r--r-- | mkvparser/mkvparser.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/m2ts/webm2pes.cc b/m2ts/webm2pes.cc index fc4b314..afa8a6b 100644 --- a/m2ts/webm2pes.cc +++ b/m2ts/webm2pes.cc @@ -68,7 +68,7 @@ void PesOptionalHeader::SetPtsBits(std::int64_t pts_90khz) { // Top 8 bits of second PTS chunk. buffer[3] |= (pts3 >> 7) & 0xff; // bottom 7 bits of second PTS chunk. - buffer[4] |= (pts3 << 1); + buffer[4] |= (pts3 << 1) & 0xff; // Marker. buffer[4] |= 1; diff --git a/mkvparser/mkvparser.cc b/mkvparser/mkvparser.cc index de8884b..fea1124 100644 --- a/mkvparser/mkvparser.cc +++ b/mkvparser/mkvparser.cc @@ -298,7 +298,7 @@ long UnserializeInt(IMkvReader* pReader, long long pos, long long size, if (status < 0) return status; - unsigned long long result = first_byte; + unsigned long long result = static_cast<unsigned long long>(first_byte); ++pos; for (long i = 1; i < size; ++i) { |