Fix parameter check 93/305793/4 accepted/tizen/unified/20240213.171947 accepted/tizen/unified/x/20240219.013930
authorKwanghoon Son <k.son@samsung.com>
Thu, 8 Feb 2024 01:48:52 +0000 (01:48 +0000)
committerKwanghoon Son <k.son@samsung.com>
Thu, 8 Feb 2024 03:40:04 +0000 (03:40 +0000)
[Issue type] Fix

TCT need INVALID_PATH instead of INVALID_PARAMETER

Fixed: 7c71a2aa35c62247032f9ea0f7771badcf1d23a9
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
Change-Id: Ia727988cdabc09092239b5d806905e28662061f8

mv_barcode/barcode_generator/src/mv_barcode_generate.cpp

index 339767f..3bdaed5 100644 (file)
@@ -95,15 +95,17 @@ int mv_barcode_generate_image(mv_engine_config_h engine_cfg, const char *message
        MEDIA_VISION_FUNCTION_ENTER();
        MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_CHECK_ERR(__check_barcode_param(message, type, qr_enc_mode, qr_ecc, qr_version), "Invalid parameter");
-       MEDIA_VISION_NULL_ARG_CHECK(image_path);
        if (image_format < MV_BARCODE_IMAGE_FORMAT_BMP || image_format >= MV_BARCODE_IMAGE_FORMAT_NUM) {
                LOGE("Not supported image format [%d]", image_format);
                return MEDIA_VISION_ERROR_INVALID_PARAMETER;
        }
+       if (image_path == NULL) {
+               LOGE("image_path is NULL");
+               return MEDIA_VISION_ERROR_INVALID_PATH;
+       }
        if (image_width <= 0 || image_height <= 0) {
                LOGE("Barcode image size is invalid: %d x %d. Terminate write to the image operation", image_width,
                         image_height);
-               // TCT need INVALID_DATA instead of INVALID_PARAMETER
                return MEDIA_VISION_ERROR_INVALID_DATA;
        }