Commit 350a0e3f by ziyue

防止内存越界

parent 0a3bcdab
...@@ -132,8 +132,8 @@ bool AACRtpDecoder::inputRtp(const RtpPacket::Ptr &rtp, bool key_pos) { ...@@ -132,8 +132,8 @@ bool AACRtpDecoder::inputRtp(const RtpPacket::Ptr &rtp, bool key_pos) {
} }
void AACRtpDecoder::flushData() { void AACRtpDecoder::flushData() {
auto ptr = reinterpret_cast<const uint8_t *>(_frame->_buffer.data()); auto ptr = reinterpret_cast<const uint8_t *>(_frame->data());
if ((ptr[0] == 0xFF && (ptr[1] & 0xF0) == 0xF0)) { if ((ptr[0] == 0xFF && (ptr[1] & 0xF0) == 0xF0) && _frame->size() > ADTS_HEADER_LEN) {
//adts头打入了rtp包,不符合规范,兼容EasyPusher的bug //adts头打入了rtp包,不符合规范,兼容EasyPusher的bug
_frame->_prefix_size = ADTS_HEADER_LEN; _frame->_prefix_size = ADTS_HEADER_LEN;
} else { } else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论