tizen-sink/source: fix svace defects 56/283256/2 accepted/tizen/unified/20221102.020514
authorJaechul Lee <jcsing.lee@samsung.com>
Fri, 21 Oct 2022 02:55:55 +0000 (11:55 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Fri, 21 Oct 2022 02:59:13 +0000 (11:59 +0900)
This commit fixes warnings as follows

NO_CAST.INTEGER_OVERFLOW
SEC_INVALID_ASSIGNMENT_WITH_UNSIGNED_VALUES

[Version] 15.0.32
[Issue Type] Svace

Change-Id: I901662abb6efdc5171d58d4042e5e4140a69c1d0
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
packaging/pulseaudio-modules-tizen.spec
src/module-tizenaudio-sink.c
src/module-tizenaudio-source.c
src/tizenaudio-sink2.c
src/tizenaudio-source2.c

index 89d8757..d24a56e 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          15.0.31
+Version:          15.0.32
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index bb86007..187ebf1 100644 (file)
@@ -635,7 +635,7 @@ int pa__init(pa_module*m) {
     pa_proplist_sets(data.proplist, PA_PROP_DEVICE_API, "tizen");
 
     frame_size = pa_frame_size(&ss);
-    buffer_size = u->frag_size * u->nfrags;
+    buffer_size = (size_t)(u->frag_size * u->nfrags);
     buffer_frames = buffer_size / frame_size;
     period_frames = u->frag_size / frame_size;
     pa_proplist_setf(data.proplist, PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%zu", buffer_frames * frame_size);
index 746eb74..618c803 100644 (file)
@@ -536,7 +536,7 @@ int pa__init(pa_module*m) {
     pa_proplist_sets(data.proplist, PA_PROP_DEVICE_API, "tizen");
 
     frame_size = pa_frame_size(&ss);
-    buffer_size = u->frag_size * u->nfrags;
+    buffer_size = (size_t)(u->frag_size * u->nfrags);
     buffer_frames = buffer_size / frame_size;
     period_frames = u->frag_size / frame_size;
     pa_proplist_setf(data.proplist, PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%zu", buffer_frames * frame_size);
index f8601ac..9741901 100644 (file)
@@ -459,7 +459,7 @@ pa_sink *pa_tizenaudio_sink2_new(pa_module *m,
 
     param.direction = DIRECTION_OUT;
     param.ss = ss;
-    param.period_size = u->frag_size / pa_frame_size(&ss);
+    param.period_size = (uint32_t)(u->frag_size / pa_frame_size(&ss));
     param.periods = u->nfrags;
 
     pa_log_info("Try to open device with rate(%d), channels(%d), format(%s), period_size(%u), periods(%u)",
@@ -504,7 +504,7 @@ pa_sink *pa_tizenaudio_sink2_new(pa_module *m,
         }
 
         frame_size = pa_frame_size(&param.ss);
-        u->frag_size = period_size * frame_size;
+        u->frag_size = (uint32_t)(period_size * frame_size);
          /* TODO: can't trust periods value from hal */
         u->nfrags = param.periods;
 
index 948e8f0..41bc90e 100644 (file)
@@ -461,7 +461,7 @@ pa_source *pa_tizenaudio_source2_new(pa_module *m,
 
     param.direction = DIRECTION_IN;
     param.ss = ss;
-    param.period_size = u->frag_size / pa_frame_size(&ss);
+    param.period_size = (uint32_t)(u->frag_size / pa_frame_size(&ss));
     param.periods = u->nfrags;
 
     pa_log_info("Try to open device with rate(%d), channels(%d), format(%s), period_size(%u), periods(%u)",
@@ -506,7 +506,7 @@ pa_source *pa_tizenaudio_source2_new(pa_module *m,
         }
 
         frame_size = pa_frame_size(&param.ss);
-        u->frag_size = period_size * frame_size;
+        u->frag_size = (uint32_t)(period_size * frame_size);
          /* TODO: can't trust periods value from hal */
         u->nfrags = param.periods;