Fix Svace issues - INVARIANT_RESULT.OP_ZERO, SIZEOF_POINTER_TYPE 74/141574/1 accepted/tizen/unified/20170810.171613 submit/tizen/20170809.053234
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 1 Aug 2017 05:05:35 +0000 (14:05 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 1 Aug 2017 05:13:05 +0000 (14:13 +0900)
[Version] 0.3.3
[Profile] Common
[Issue Type] Svace
[Dependency module] N/A

Change-Id: I85365deeb093db0e562d7af983bd21e684c0e386
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
legacy/src/legacy_camera.c
legacy/src/legacy_camera_internal.c
muse/src/muse_camera_dispatcher.c
packaging/mmsvc-camera.spec

index 33da403..92ddf78 100644 (file)
@@ -709,7 +709,7 @@ int legacy_camera_change_device(camera_h *camera, camera_device_e device, bool i
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (device < CAMERA_DEVICE_CAMERA0 || device > CAMERA_DEVICE_CAMERA1) {
+       if (device > CAMERA_DEVICE_CAMERA1) {
                LOGE("invalid device %d", device);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -1679,7 +1679,7 @@ int legacy_camera_set_display_rotation(camera_h camera, camera_rotation_e rotati
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (rotation < CAMERA_ROTATION_NONE || rotation > CAMERA_ROTATION_270) {
+       if (rotation > CAMERA_ROTATION_270) {
                LOGE("invalid rotation %d", rotation);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -1720,7 +1720,7 @@ int legacy_camera_set_display_flip(camera_h camera, camera_flip_e flip)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (flip < CAMERA_FLIP_NONE || flip > CAMERA_FLIP_BOTH) {
+       if (flip > CAMERA_FLIP_BOTH) {
                LOGE("invalid flip %d", flip);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -1801,7 +1801,7 @@ int legacy_camera_set_display_mode(camera_h camera, camera_display_mode_e mode)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (mode < CAMERA_DISPLAY_MODE_LETTER_BOX || mode > CAMERA_DISPLAY_MODE_CUSTOM_ROI) {
+       if (mode > CAMERA_DISPLAY_MODE_CUSTOM_ROI) {
                LOGE("invalid mode %d", mode);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -2410,7 +2410,7 @@ int legacy_camera_attr_set_theater_mode(camera_h camera, camera_attr_theater_mod
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (mode < CAMERA_ATTR_THEATER_MODE_DISABLE || mode > CAMERA_ATTR_THEATER_MODE_ENABLE) {
+       if (mode > CAMERA_ATTR_THEATER_MODE_ENABLE) {
                LOGE("invalid theater mode %d", mode);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -2476,7 +2476,7 @@ int legacy_camera_attr_set_preview_fps(camera_h camera, camera_attr_fps_e fps)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (fps < CAMERA_ATTR_FPS_AUTO || fps > CAMERA_ATTR_FPS_120) {
+       if (fps > CAMERA_ATTR_FPS_120) {
                LOGE("invalid preview fps %d", fps);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -2597,7 +2597,7 @@ int legacy_camera_attr_set_af_mode(camera_h camera, camera_attr_af_mode_e mode)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (mode < CAMERA_ATTR_AF_NONE || mode > CAMERA_ATTR_AF_FULL) {
+       if (mode > CAMERA_ATTR_AF_FULL) {
                LOGE("invalid mode %d", mode);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -2716,7 +2716,7 @@ int legacy_camera_attr_set_exposure_mode(camera_h camera, camera_attr_exposure_m
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (mode < CAMERA_ATTR_EXPOSURE_MODE_OFF || mode > CAMERA_ATTR_EXPOSURE_MODE_CUSTOM) {
+       if (mode > CAMERA_ATTR_EXPOSURE_MODE_CUSTOM) {
                LOGE("invalid exposure mode %d", mode);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -2765,7 +2765,7 @@ int legacy_camera_attr_set_iso(camera_h camera, camera_attr_iso_e iso)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (iso < CAMERA_ATTR_ISO_AUTO || iso > CAMERA_ATTR_ISO_3200) {
+       if (iso > CAMERA_ATTR_ISO_3200) {
                LOGE("invalid iso %d", iso);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -2824,7 +2824,7 @@ int legacy_camera_attr_set_whitebalance(camera_h camera, camera_attr_whitebalanc
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (wb < CAMERA_ATTR_WHITE_BALANCE_NONE || wb > CAMERA_ATTR_WHITE_BALANCE_CUSTOM) {
+       if (wb > CAMERA_ATTR_WHITE_BALANCE_CUSTOM) {
                LOGE("invalid white balance %d", wb);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -2847,7 +2847,7 @@ int legacy_camera_attr_set_effect(camera_h camera, camera_attr_effect_mode_e eff
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (effect < CAMERA_ATTR_EFFECT_NONE || effect > CAMERA_ATTR_EFFECT_OTHER_GRAPHICS) {
+       if (effect > CAMERA_ATTR_EFFECT_OTHER_GRAPHICS) {
                LOGE("invalid effect %d", effect);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -2870,7 +2870,7 @@ int legacy_camera_attr_set_scene_mode(camera_h camera, camera_attr_scene_mode_e
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (mode < CAMERA_ATTR_SCENE_MODE_NORMAL || mode > CAMERA_ATTR_SCENE_MODE_AQUA) {
+       if (mode > CAMERA_ATTR_SCENE_MODE_AQUA) {
                LOGE("invalid scene mode %d", mode);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -3015,7 +3015,7 @@ int legacy_camera_attr_set_flash_mode(camera_h camera, camera_attr_flash_mode_e
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (mode < CAMERA_ATTR_FLASH_MODE_OFF || mode > CAMERA_ATTR_FLASH_MODE_PERMANENT) {
+       if (mode > CAMERA_ATTR_FLASH_MODE_PERMANENT) {
                LOGE("invalid flash mode %d", mode);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -3784,7 +3784,7 @@ int legacy_camera_attr_set_stream_rotation(camera_h camera, camera_rotation_e ro
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (rotation < CAMERA_ROTATION_NONE || rotation > CAMERA_ROTATION_270) {
+       if (rotation > CAMERA_ROTATION_270) {
                LOGE("invalid stream rotation %d", rotation);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -3825,7 +3825,7 @@ int legacy_camera_attr_set_stream_flip(camera_h camera, camera_flip_e flip)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (flip < CAMERA_FLIP_NONE || flip > CAMERA_FLIP_BOTH) {
+       if (flip > CAMERA_FLIP_BOTH) {
                LOGE("invalid stream flip %d", flip);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
@@ -3911,7 +3911,7 @@ int legacy_camera_attr_set_hdr_mode(camera_h camera, camera_attr_hdr_mode_e mode
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       if (mode < CAMERA_ATTR_HDR_MODE_DISABLE || mode > CAMERA_ATTR_HDR_MODE_KEEP_ORIGINAL) {
+       if (mode > CAMERA_ATTR_HDR_MODE_KEEP_ORIGINAL) {
                LOGE("invalid HDR mode %d", mode);
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
index c270cf1..28dd012 100644 (file)
@@ -83,7 +83,7 @@ int legacy_camera_set_gdbus_connection(camera_h camera, void *gdbus_connection)
        LOGD("gdbus connection %p", gdbus_connection);
 
        ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
-               MMCAM_GDBUS_CONNECTION, gdbus_connection, sizeof(gdbus_connection),
+               MMCAM_GDBUS_CONNECTION, gdbus_connection, sizeof(*gdbus_connection),
                NULL);
 
        return __convert_camera_error_code(__func__, ret);
index a5cae20..b2e116a 100644 (file)
@@ -2383,7 +2383,7 @@ int camera_dispatcher_get_flash_state(muse_module_h module)
 
        muse_camera_msg_get(device_type, muse_core_client_get_msg(module));
 
-       if (device_type < CAMERA_DEVICE_CAMERA0 || device_type > CAMERA_DEVICE_CAMERA1) {
+       if (device_type > CAMERA_DEVICE_CAMERA1) {
                LOGE("invalid device %d", device_type);
 
                ret = CAMERA_ERROR_INVALID_PARAMETER;
@@ -5053,7 +5053,7 @@ int camera_dispatcher_get_device_state(muse_module_h module)
 
        muse_camera_msg_get(device_type, muse_core_client_get_msg(module));
 
-       if (device_type < CAMERA_DEVICE_CAMERA0 || device_type > CAMERA_DEVICE_CAMERA1) {
+       if (device_type > CAMERA_DEVICE_CAMERA1) {
                LOGE("invalid device %d", device_type);
 
                ret = CAMERA_ERROR_INVALID_PARAMETER;
index fddcca8..8d73dab 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-camera
 Summary:    A Camera module for muse server
-Version:    0.3.2
+Version:    0.3.3
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0