From: Kwanghoon Son Date: Thu, 8 Feb 2024 01:48:52 +0000 (+0000) Subject: Fix parameter check X-Git-Tag: accepted/tizen/unified/20240213.171947^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a7f0c5068c520565e64e127002b3d7b00363abf;p=platform%2Fcore%2Fapi%2Fmediavision.git Fix parameter check [Issue type] Fix TCT need INVALID_PATH instead of INVALID_PARAMETER Fixed: 7c71a2aa35c62247032f9ea0f7771badcf1d23a9 Signed-off-by: Kwanghoon Son Change-Id: Ia727988cdabc09092239b5d806905e28662061f8 --- diff --git a/mv_barcode/barcode_generator/src/mv_barcode_generate.cpp b/mv_barcode/barcode_generator/src/mv_barcode_generate.cpp index 339767fe..3bdaed52 100644 --- a/mv_barcode/barcode_generator/src/mv_barcode_generate.cpp +++ b/mv_barcode/barcode_generator/src/mv_barcode_generate.cpp @@ -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; }