[single] Fix possible svace issue later
authorParichay Kapoor <pk.kapoor@samsung.com>
Thu, 24 Oct 2019 05:15:04 +0000 (14:15 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Thu, 24 Oct 2019 15:35:44 +0000 (00:35 +0900)
Fix possible svace issue later
https://github.com/nnsuite/nnstreamer/pull/1787#discussion_r337823705

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
api/capi/src/nnstreamer-capi-single-new.c

index 34a65f9..e1b281f 100644 (file)
@@ -763,7 +763,7 @@ int ml_single_set_input_info (ml_single_h single, const ml_tensors_info_h info)
   switch (single_h->nnfw) {
     case ML_NNFW_TYPE_TENSORFLOW_LITE:
       klass = g_type_class_peek (G_TYPE_TENSOR_FILTER_SINGLE);
-      if (klass->set_input_info (single_h->filter, info) == FALSE)
+      if (klass == NULL || klass->set_input_info (single_h->filter, info) == FALSE)
         status = ML_ERROR_INVALID_PARAMETER;
       break;
     default: