Closed mpthompson closed 6 years ago
For some reason the aravis library returns a "fake_" camera with vendor and model set to NULL. The following checks in QArvCameraId() constructor protects against segmentation violations in this instance and gets the application running.
QArvCameraId::QArvCameraId(const char* id_,
const char* vendor_,
const char* model_) {
if (id_ == nullptr) id_ = "";
if (vendor_ == nullptr) vendor_ = "";
if (model_ == nullptr) model_ = "";
id = strdup(id_);
vendor = strdup(vendor_);
model = strdup(model_);
}
Thanks for noticing this! I just commited a fix for both contructors. I also made sure that cameras with null ids are not listed. That shouldn't happen, but then, neither should null vendor or model :/ . It definitely doesn't happen here (Aravis 0.5.12 on Arch Linux). If you ever find out why it happens to you, please let me know as it might be something that QArv should check.
When using a build of 'qarv' from the master branch and the libraries from the latest Aravis 0.5.12 release, within seconds after starting 'qarv' the application receives a segmentation fault with the following stack trace from gdb:
I haven't yet had time to figure out how to use cmake to create a debug build to investigate further, but I assume there is a problem with a string being passed into the QArvCameraId::QArvCameraId() object constructor. If I figure out the issue, I'll post back a fix.