diff --git a/webrtc/RtpExt.cpp b/webrtc/RtpExt.cpp index 64039a82..ac4143d5 100644 --- a/webrtc/RtpExt.cpp +++ b/webrtc/RtpExt.cpp @@ -162,9 +162,9 @@ size_t RtpExt::size() const { return _size; } -const char& RtpExt::operator[](size_t pos) const{ +const uint8_t& RtpExt::operator[](size_t pos) const{ CHECK(pos < _size); - return _data[pos]; + return ((uint8_t*)_data)[pos]; } RtpExt::operator std::string() const{ diff --git a/webrtc/RtpExt.h b/webrtc/RtpExt.h index 2a004aa5..d53a4a9b 100644 --- a/webrtc/RtpExt.h +++ b/webrtc/RtpExt.h @@ -99,7 +99,7 @@ private: RtpExt(void *ptr, bool one_byte_ext, const char *str, size_t size); const char *data() const; size_t size() const; - const char& operator[](size_t pos) const; + const uint8_t& operator[](size_t pos) const; operator std::string() const; private: