Fix crash in case of calling some functions which has a bool type parameter 48/165248/3
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 27 Dec 2017 08:30:48 +0000 (17:30 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Wed, 27 Dec 2017 08:40:19 +0000 (17:40 +0900)
[Version] 0.3.11
[Profile] Common
[Issue Type] Bug fix
[Dependency module] N/A

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

index d16fc79..20a29e7 100644 (file)
@@ -1788,7 +1788,7 @@ int legacy_camera_is_display_visible(camera_h camera, bool* visible)
                NULL);
 
        if (ret == MM_ERROR_NONE)
-               *visible = result;
+               *visible = (bool)result;
 
        return __convert_camera_error_code(__func__, ret);
 }
@@ -3413,12 +3413,16 @@ int legacy_camera_attr_is_enabled_tag(camera_h camera, bool *enable)
        }
 
        int ret = MM_ERROR_NONE;
+       int get_enabled = 0;
        camera_s *handle = (camera_s *)camera;
 
        ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
-               MMCAM_TAG_ENABLE, enable,
+               MMCAM_TAG_ENABLE, get_enabled,
                NULL);
 
+       if (ret == MM_ERROR_NONE)
+               *enable = (bool)get_enabled;
+
        return __convert_camera_error_code(__func__, ret);
 }
 
@@ -4148,12 +4152,16 @@ int legacy_camera_attr_is_enabled_anti_shake(camera_h camera, bool *enabled)
        }
 
        int ret = MM_ERROR_NONE;
+       int get_enabled = 0;
        camera_s *handle = (camera_s *)camera;
 
        ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
-               MMCAM_CAMERA_ANTI_HANDSHAKE, enabled,
+               MMCAM_CAMERA_ANTI_HANDSHAKE, get_enabled,
                NULL);
 
+       if (ret == MM_ERROR_NONE)
+               *enabled = (bool)get_enabled;
+
        return __convert_camera_error_code(__func__, ret);
 }
 
@@ -4237,8 +4245,9 @@ int legacy_camera_attr_is_enabled_video_stabilization(camera_h camera, bool *ena
        ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
                MMCAM_CAMERA_VIDEO_STABILIZATION, &mode,
                NULL);
+
        if (ret == MM_ERROR_NONE)
-               *enabled = (mode == MM_CAMCORDER_VIDEO_STABILIZATION_ON);
+               *enabled = (bool)mode;
 
        return __convert_camera_error_code(__func__, ret);
 }
@@ -4325,7 +4334,7 @@ int legacy_camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled)
                NULL);
 
        if (ret == MM_ERROR_NONE)
-               *enabled = mode;
+               *enabled = (bool)mode;
 
        return __convert_camera_error_code(__func__, ret);
 }
index d57df7d..8938f05 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-camera
 Summary:    A Camera module for muse server
-Version:    0.3.10
+Version:    0.3.11
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0