1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #21083 from OrestChura:oc/fix_coverity_vino_issues

[G-API] Fixed Coverity issues

* Fixed Coverity issues
 - VectorRef&OpaqueRef m_kind = CV_UNKNOWN
 - added same-type overload for saturate()
 - sanitized resize value in ByteMemoryInStream::operator>> (std::string& str)
 - handled throws from ~GStreamingExecutor()

* Catching exception by const ref

* Addressing Sergey's comments

* Applied enable_if semanitcs to saturate(x, round) too

* Removed uncaught_exception, made destructor noexcept back

* Split Fluid ConvertTo to multiple functions to avoid ifs; added CV_ALWAYS_INLINE

* Added FIXME to address throwings from stop()

* Fix standalone

* Addressing comments

* Guarded SIMD optimizations properly

* Removed excess parameter from simd_impl functions
This commit is contained in:
Orest Chura
2021-11-26 19:40:36 +03:00
committed by GitHub
parent b95d71af2b
commit 2deb38d615
7 changed files with 157 additions and 115 deletions
@@ -24,6 +24,8 @@
#include "backends/streaming/gstreamingbackend.hpp" // GCopy
#include "compiler/gcompiler.hpp" // for compileIslands
#include <logger.hpp>
#include "executor/gstreamingexecutor.hpp"
#include <opencv2/gapi/streaming/meta.hpp>
@@ -1382,8 +1384,16 @@ cv::gimpl::GStreamingExecutor::GStreamingExecutor(std::unique_ptr<ade::Graph> &&
cv::gimpl::GStreamingExecutor::~GStreamingExecutor()
{
if (state == State::READY || state == State::RUNNING)
stop();
// FIXME: this is a temporary try-catch exception hadling.
// Need to eliminate throwings from stop()
try {
if (state == State::READY || state == State::RUNNING)
stop();
} catch (const std::exception& e) {
std::stringstream message;
message << "~GStreamingExecutor() threw exception with message '" << e.what() << "'\n";
GAPI_LOG_WARNING(NULL, message.str());
}
}
void cv::gimpl::GStreamingExecutor::setSource(GRunArgs &&ins)