修复丢包导致aac确实导致内存越界的bug: #1363

This commit is contained in:
ziyue 2022-01-14 13:09:47 +08:00
parent 402214c3d4
commit 75465311d9

View File

@ -279,6 +279,11 @@ bool AACTrack::inputFrame(const Frame::Ptr &frame) {
}
auto sub_frame = std::make_shared<FrameInternal<FrameFromPtr> >(frame, (char *) ptr, frame_len, ADTS_HEADER_LEN);
ptr += frame_len;
if (ptr > end) {
WarnL << "invalid aac length in adts header: " << frame_len
<< ", remain data size: " << end - (ptr - frame_len);
break;
}
sub_frame->setCodecId(CodecAAC);
if (inputFrame_l(sub_frame)) {
ret = true;