Visual Studio 2022 C++中的错误QT项目
我正在使用QT和OPENCV的Visual Studio 2022上的C ++项目。 我正在使用videocapture使用Open()函数打开RTSP流。
但是,当我尝试打开RTSP流时,我会得到以下例外:
Exception thrown at 0x00007FFB37BB4F69 in faulty.exe: Microsoft C++ exception: MONZA::DdiThreadingContext<MONZA::AdapterTraits_Gen12LP>::msg_end at memory location 0x00000029218FF9F0.
The thread 0x45d8 has exited with code 0 (0x0).
相关代码如下:
string un = port_ipDialog->devInfo.szUserName;
string stri = "rtsp://" + un + ":" + PWD + "@" + IP + "/gen/fakescreen?channel=5&subtype=2";
memcpy(rtsp, stri.c_str(), 256);
if (!capture.open(rtsp)) {
QMessageBox::warning(nullptr, "notice", "fail!!", QMessageBox::Yes | QMessageBox::Yes);
return;
}
奇怪的是,同一件事在另一台计算机上正常工作。
有人可以深入了解这个例外吗?为什么会发生这种情况? 我会很感激。
I am working on a C++ project on Visual Studio 2022 with Qt and OpenCV.
I am using VideoCapture to open an rtsp stream using the open() function.
However, I get an exception as follows when I try to open the rtsp stream:
Exception thrown at 0x00007FFB37BB4F69 in faulty.exe: Microsoft C++ exception: MONZA::DdiThreadingContext<MONZA::AdapterTraits_Gen12LP>::msg_end at memory location 0x00000029218FF9F0.
The thread 0x45d8 has exited with code 0 (0x0).
The relevant code is as follows:
string un = port_ipDialog->devInfo.szUserName;
string stri = "rtsp://" + un + ":" + PWD + "@" + IP + "/gen/fakescreen?channel=5&subtype=2";
memcpy(rtsp, stri.c_str(), 256);
if (!capture.open(rtsp)) {
QMessageBox::warning(nullptr, "notice", "fail!!", QMessageBox::Yes | QMessageBox::Yes);
return;
}
The strange thing is that the same thing is working perfectly on another computer.
Can someone give some insight into this exception and why it might be occurring?
I would be grateful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Thi9s线调用UB的
输入较短256,还有RTSP的大小是多少?
为什么不使用
strcpy
well thi9s line invokes UB
the input is shorter that 256, also what is the size of rtsp?
Why not use
strcpy