Fix Svace issues - INVARIANT_RESULT.OP_ZERO, SIZEOF_POINTER_TYPE 77/141577/1
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 1 Aug 2017 05:07:18 +0000 (14:07 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 1 Aug 2017 05:14:42 +0000 (14:14 +0900)
[Version] 0.3.2
[Profile] Common
[Issue Type] Svace
[Dependency module] N/A

Change-Id: Ibe47c7d96a67d8350ffaef2e297ebdbb49dcba5a
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
legacy/src/legacy_recorder.c
legacy/src/legacy_recorder_internal.c
muse/src/muse_recorder_dispatcher.c
packaging/mmsvc-recorder.spec

index a16edfe..89777e2 100644 (file)
@@ -1111,7 +1111,7 @@ int legacy_recorder_set_file_format(recorder_h recorder, recorder_file_format_e
                MM_FILE_FORMAT_M2TS /* RECORDER_FILE_FORMAT_M2TS */
        };
 
-       if (format < RECORDER_FILE_FORMAT_3GP || format > RECORDER_FILE_FORMAT_M2TS) {
+       if (format > RECORDER_FILE_FORMAT_M2TS) {
                LOGE("invalid format %d", format);
                return RECORDER_ERROR_INVALID_PARAMETER;
        }
@@ -1594,7 +1594,7 @@ int legacy_recorder_attr_set_time_limit(recorder_h recorder, int second)
 
 int legacy_recorder_attr_set_audio_device(recorder_h recorder, recorder_audio_device_e device)
 {
-       if (device < RECORDER_AUDIO_DEVICE_MIC || device > RECORDER_AUDIO_DEVICE_MODEM) {
+       if (device > RECORDER_AUDIO_DEVICE_MODEM) {
                LOGE("invalid device %d", device);
                return RECORDER_ERROR_INVALID_PARAMETER;
        }
@@ -1704,7 +1704,7 @@ int legacy_recorder_set_video_encoder(recorder_h recorder, recorder_video_codec_
                return RECORDER_ERROR_NOT_SUPPORTED;
        }
 
-       if (codec < RECORDER_VIDEO_CODEC_H263 || codec > RECORDER_VIDEO_CODEC_THEORA) {
+       if (codec > RECORDER_VIDEO_CODEC_THEORA) {
                LOGE("invalid codec %d", codec);
                return RECORDER_ERROR_INVALID_PARAMETER;
        }
index df11a5b..08577ef 100644 (file)
@@ -77,7 +77,7 @@ int legacy_recorder_set_gdbus_connection(recorder_h recorder, void *gdbus_connec
        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_recorder_error_code(__func__, ret);
index 6c5b31f..a676d79 100644 (file)
@@ -2242,7 +2242,7 @@ int recorder_dispatcher_get_device_state(muse_module_h module)
 
        muse_recorder_msg_get(recorder_type, muse_core_client_get_msg(module));
 
-       if (recorder_type < RECORDER_TYPE_AUDIO || recorder_type > RECORDER_TYPE_VIDEO) {
+       if (recorder_type > RECORDER_TYPE_VIDEO) {
                LOGE("invalid type %d", recorder_type);
                ret = CAMERA_ERROR_INVALID_PARAMETER;
                muse_recorder_msg_return(api, class, ret, module);
index 595264c..4e98198 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-recorder
 Summary:    A Recorder module for muse server
-Version:    0.3.1
+Version:    0.3.2
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0