解析rtp时,兼容rtsp服务端发送缓冲区溢出覆盖的bug

This commit is contained in:
xiongziliang 2024-06-02 13:11:45 +08:00
parent 68c0424808
commit 189b02e400

View File

@ -13,6 +13,7 @@
#include "Util/util.h"
#include "Util/logger.h"
#include "Common/macros.h"
#include "Rtsp/RtpReceiver.h"
using namespace std;
using namespace toolkit;
@ -59,7 +60,11 @@ const char *RtspSplitter::onSearchPacketTail_l(const char *data, size_t len) {
ssize_t RtspSplitter::onRecvHeader(const char *data, size_t len) {
if (_isRtpPacket) {
onRtpPacket(data, len);
try {
onRtpPacket(data, len);
} catch (RtpTrack::BadRtpException &ex) {
WarnL << ex.what();
}
return 0;
}
if (len == 4 && !memcmp(data, "\r\n\r\n", 4)) {