wfd, audioeq: Fix svace issues - NO_CAST.INTEGER_OVERFLOW, SIGNED_TO_BIGGER_UNSIGNED 54/304654/1 accepted/tizen/8.0/unified/20240123.170043
authorYoungwoo Cho <young222.cho@samsung.com>
Mon, 22 Jan 2024 01:50:50 +0000 (10:50 +0900)
committerYoungwoo Cho <young222.cho@samsung.com>
Tue, 23 Jan 2024 01:34:09 +0000 (10:34 +0900)
[Version] 1.22.0-14
[Issue Type] Svace

Change-Id: I4934acab6c6c2d36f85202fe51cdad14fd120943
Signed-off-by: Youngwoo Cho <young222.cho@samsung.com>
audioeq/src/gstaudioeq.c
packaging/gst-plugins-tizen.spec
wfdmanager/wfdrtpbuffer/wfdrtpbuffer.c
wfdtsdemux/wfdtspacketizer.c

index 5ae865e..4527bee 100644 (file)
@@ -1147,7 +1147,7 @@ gst_audioeq_set_caps (GstBaseTransform * base, GstCaps * incaps, GstCaps * outca
   }
   /* get number of channels from caps */
   gst_structure_get_int(ins, "channels", &channels);
-  audioeq->channels = (gshort)channels;
+  audioeq->channels = (guint)channels;
 
   if ((old_samplerate != audioeq->samplerate)
     || (old_channels != audioeq->channels)) {
index e58218e..627e8aa 100644 (file)
@@ -5,7 +5,7 @@
 Name:       gst-plugins-tizen
 Version:    1.22.0
 Summary:    GStreamer tizen plugins (common)
-Release:    13
+Release:    14
 Group:      Multimedia/Framework
 Url:        http://gstreamer.freedesktop.org/
 License:    LGPL-2.1+
index 6874a0a..0cd867c 100644 (file)
@@ -532,7 +532,7 @@ calculate_skew (WfdRTPBuffer * jbuf, guint32 rtptime, GstClockTime time)
       /* quickly go to the min value when we are filling up, slowly when we are
        * just starting because we're not sure it's a good value yet. */
       jbuf->skew =
-          (perc * jbuf->window_min + ((10000 - perc) * jbuf->skew)) / 10000;
+          (perc * jbuf->window_min + ((10000 - (gint64)perc) * jbuf->skew)) / 10000;
       jbuf->window_size = pos + 1;
     }
   } else {
@@ -733,10 +733,11 @@ wfd_rtp_buffer_insert (WfdRTPBuffer * jbuf, WfdRTPBufferItem * item,
       jbuf->mode != WFD_RTP_BUFFER_MODE_SLAVE &&
       jbuf->base_time != -1 && jbuf->last_rtptime != -1) {
     GstClockTime ext_rtptime = jbuf->ext_rtptime;
+    guint64 multiplied_clock_rate = 3 * (guint64)jbuf->clock_rate;
 
     ext_rtptime = gst_rtp_buffer_ext_timestamp (&ext_rtptime, rtptime);
-    if (ext_rtptime > jbuf->last_rtptime + 3 * jbuf->clock_rate ||
-        ext_rtptime + 3 * jbuf->clock_rate < jbuf->last_rtptime) {
+    if (ext_rtptime > jbuf->last_rtptime + multiplied_clock_rate ||
+        ext_rtptime + multiplied_clock_rate < jbuf->last_rtptime) {
       /* reset even if we don't have valid incoming time;
        * still better than producing possibly very bogus output timestamp */
       GST_WARNING ("rtp delta too big, reset skew");
index 9e9894c..d6ee5b1 100644 (file)
@@ -1433,7 +1433,7 @@ calculate_skew (WFDTSPCR * pcr, guint64 pcrtime, GstClockTime time)
       /* quickly go to the min value when we are filling up, slowly when we are
        * just starting because we're not sure it's a good value yet. */
       pcr->skew =
-          (perc * pcr->window_min + ((10000 - perc) * pcr->skew)) / 10000;
+          (perc * pcr->window_min + ((10000 - (gint64)perc) * pcr->skew)) / 10000;
       pcr->window_size = pos + 1;
     }
   } else {