From fc5b09365e2898a7372d2426dbc586b200c47585 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Wed, 6 Oct 2021 22:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Drtp=20ext=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E7=9B=B8=E5=85=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/RtpExt.cpp | 4 ++-- webrtc/RtpExt.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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: