mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-23 03:10:04 +08:00
防止内存越界
This commit is contained in:
parent
0a3bcdab15
commit
350a0e3f81
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user