mv_machine_learning: fix DEREF_OF_NULL_RET.STAT svace issue 51/296451/2 accepted/tizen/unified/20230801.174230
authorInki Dae <inki.dae@samsung.com>
Fri, 28 Jul 2023 02:24:57 +0000 (11:24 +0900)
committerInki Dae <inki.dae@samsung.com>
Fri, 28 Jul 2023 04:53:27 +0000 (13:53 +0900)
[Issue type] : bug fix
[Version] : 0.28.10

Fix two svace issues from VD KONA, DEREF_OF_NULL_RET.STAT.
WGID: 3342, 1134975

Change-Id: I292348f51b9cb9a70c48cedc281c0b92ec91a3d5
Signed-off-by: Inki Dae <inki.dae@samsung.com>
mv_machine_learning/inference/src/InputMetadata.cpp
packaging/capi-media-vision.spec

index 5c02a0f67116d84308557251326045265a6aef65..8d488b6e82e541d20532060fd29da03e270cc0ef 100644 (file)
@@ -171,6 +171,11 @@ int InputMetadata::GetPreProcess(JsonObject *root)
 
        if (json_object_has_member(preprocess_object, "resize")) {
                const char *resizer = static_cast<const char *>(json_object_get_string_member(preprocess_object, "resize"));
+               if (!resizer) {
+                       LOGE("Fail to get a string value to the resize member.");
+                       return MEDIA_VISION_ERROR_INVALID_OPERATION;
+               }
+
                if (strcmp(resizer, "LETTERBOX") == 0) {
                        opt.resizer = Resizer::LETTERBOX;
                        LOGI("resizer changed to letterbox");
index 1e5ae95b8d2fbb44c752a1f57c5f6a3d6886d616..5c1d6d1d998a349523f71a914a647541e802c273 100644 (file)
@@ -1,6 +1,6 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
-Version:     0.28.9
+Version:     0.28.10
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-3-Clause