Visual Studio 2022 C++中的错误QT项目

发布于 2025-02-03 06:21:29 字数 804 浏览 6 评论 0原文

我正在使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↙温凉少女 2025-02-10 06:21:29

Thi9s线调用UB的

 memcpy(rtsp, stri.c_str(), 256);

输入较短256,还有RTSP的大小是多少?

为什么不使用strcpy

well thi9s line invokes UB

 memcpy(rtsp, stri.c_str(), 256);

the input is shorter that 256, also what is the size of rtsp?

Why not use strcpy

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文