Protecting crash when reading ONNX model with wrong format (Object Detection effect)

This commit is contained in:
Jonathan Thomas
2026-05-10 22:26:18 -05:00
parent be99ec02c6
commit eae93e1ebf
+8
View File
@@ -98,6 +98,14 @@ void CVObjectDetection::detectObjectsClip(openshot::Clip &video, size_t _start,
processingController->SetError(true, error_text);
error = true;
return;
} catch (const std::exception& e) {
processingController->SetError(true, std::string("Failed to load ONNX model: ") + e.what());
error = true;
return;
} catch (...) {
processingController->SetError(true, "Failed to load ONNX model: unknown error");
error = true;
return;
}
setProcessingDevice();