From 76bd620b63272ec3946d8f9e3e28e2477c10a1c0 Mon Sep 17 00:00:00 2001 From: Inki Dae Date: Mon, 30 Nov 2020 16:43:22 +0900 Subject: [PATCH] mv_inference: Fix seg. fault issue at ConfigureInputInfo() mBackendCapacity will be updated after Bind call so access to mBackendCapacity shoud be done after the completion of Binding. This patch makes the Bind callback to be called before calling ConfigureTargetDevices callback. Change-Id: If074e4005d03275272dfbce636d947c5d673802a Signed-off-by: Inki Dae --- mv_inference/inference/src/mv_inference_open.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mv_inference/inference/src/mv_inference_open.cpp b/mv_inference/inference/src/mv_inference_open.cpp index 9231ee2..57ec8fd 100644 --- a/mv_inference/inference/src/mv_inference_open.cpp +++ b/mv_inference/inference/src/mv_inference_open.cpp @@ -394,6 +394,14 @@ int mv_inference_configure_engine_open(mv_inference_h infer, if (ret != MEDIA_VISION_ERROR_NONE) goto _ERROR_; + // Create a inference-engine-common class object and load its corresponding library. + // Ps. Inference engine gets a capability from a given backend by Bind call + // so access to mBackendCapacity should be done after Bind. + ret = pInfer->Bind(); + if (ret != MEDIA_VISION_ERROR_NONE) { + LOGE("Fail to bind a backend engine."); + } + if (is_new_version) { // Use new type. if (pInfer->ConfigureTargetDevices(targetTypes) != @@ -410,12 +418,6 @@ int mv_inference_configure_engine_open(mv_inference_h infer, } } - // Create a inference-engine-common class object and load its corresponding library. - ret = pInfer->Bind(); - if (ret != MEDIA_VISION_ERROR_NONE) { - LOGE("Fail to bind a backend engine."); - } - LOGI("LEAVE"); _ERROR_: return ret; -- 2.7.4