delay, filter: Fix svace issues 60/150660/1 accepted/tizen/unified/20170921.071941 submit/tizen/20170920.100911
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 18 Sep 2017 07:24:24 +0000 (16:24 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 18 Sep 2017 07:37:17 +0000 (07:37 +0000)
Add null checking codes after calloc()

[Version] 5.0.172
[Issue Type] Enhancement

Change-Id: Iee592d191770289b84436b0e9adc65dcf3798fc9
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/pulseaudio-modules-tizen.spec
src/ladspa/delay.c
src/ladspa/filter.c

index edabf2b648e7f3aaa7512f99cb848b4ff5e99b3a..414361a75cad8c4d3e41449d8cb6059c93726a8e 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          5.0.171
+Version:          5.0.172
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
@@ -32,7 +32,7 @@ This package contains pulseaudio modules for tizen audio system.
 %setup -q
 
 %build
-export CFLAGS="%{optflags} -fno-strict-aliasing -DSYSCONFDIR=\\\"%{_sysconfdir}\\\" -DAUDIOHALDIR=\\\"%{_libdir}\\\""
+export CFLAGS="%{optflags} -fno-strict-aliasing -D__TIZEN__ -DSYSCONFDIR=\\\"%{_sysconfdir}\\\" -DAUDIOHALDIR=\\\"%{_libdir}\\\""
 
 export LD_AS_NEEDED=0
 %reconfigure --prefix=%{_prefix} \
index 8b039796bde303e5d55f95fd15fac57dda6cd4f8..e16eebd9abee6bd8a841ebcd50f12cdd8ec0a802 100644 (file)
@@ -254,6 +254,10 @@ _init() {
       = 4;
     piPortDescriptors
       = (LADSPA_PortDescriptor *)calloc(4, sizeof(LADSPA_PortDescriptor));
+#ifdef __TIZEN__
+    if (piPortDescriptors == NULL)
+        return;
+#endif
     g_psDescriptor->PortDescriptors 
       = (const LADSPA_PortDescriptor *)piPortDescriptors;
     piPortDescriptors[SDL_DELAY_LENGTH]
@@ -266,6 +270,10 @@ _init() {
       = LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO;
     pcPortNames
       = (char **)calloc(4, sizeof(char *));
+#ifdef __TIZEN__
+    if (pcPortNames == NULL)
+        return;
+#endif
     g_psDescriptor->PortNames
       = (const char **)pcPortNames;
     pcPortNames[SDL_DELAY_LENGTH]
@@ -278,6 +286,10 @@ _init() {
       = strdup("Output");
     psPortRangeHints = ((LADSPA_PortRangeHint *)
                        calloc(4, sizeof(LADSPA_PortRangeHint)));
+#ifdef __TIZEN__
+    if (psPortRangeHints == NULL)
+        return;
+#endif
     g_psDescriptor->PortRangeHints
       = (const LADSPA_PortRangeHint *)psPortRangeHints;
     psPortRangeHints[SDL_DELAY_LENGTH].HintDescriptor
index 3f5045746d646aaad2cd721684fd016bc2bff663..1c382d6af774beb24d12ef49875349ad0ad57388 100644 (file)
@@ -282,6 +282,10 @@ _init() {
       = 3;
     piPortDescriptors
       = (LADSPA_PortDescriptor *)calloc(3, sizeof(LADSPA_PortDescriptor));
+#ifdef __TIZEN__
+    if (piPortDescriptors == NULL)
+        return;
+#endif
     g_psLPFDescriptor->PortDescriptors
       = (const LADSPA_PortDescriptor *)piPortDescriptors;
     piPortDescriptors[SF_CUTOFF]
@@ -292,6 +296,10 @@ _init() {
       = LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO;
     pcPortNames
       = (char **)calloc(3, sizeof(char *));
+#ifdef __TIZEN__
+    if (pcPortNames == NULL)
+        return;
+#endif
     g_psLPFDescriptor->PortNames 
       = (const char **)pcPortNames;
     pcPortNames[SF_CUTOFF]
@@ -302,6 +310,10 @@ _init() {
       = strdup("Output");
     psPortRangeHints = ((LADSPA_PortRangeHint *)
                        calloc(3, sizeof(LADSPA_PortRangeHint)));
+#ifdef __TIZEN__
+    if (psPortRangeHints == NULL)
+        return;
+#endif
     g_psLPFDescriptor->PortRangeHints
       = (const LADSPA_PortRangeHint *)psPortRangeHints;
     psPortRangeHints[SF_CUTOFF].HintDescriptor
@@ -354,6 +366,10 @@ _init() {
       = 3;
     piPortDescriptors
       = (LADSPA_PortDescriptor *)calloc(3, sizeof(LADSPA_PortDescriptor));
+#ifdef __TIZEN__
+    if (piPortDescriptors == NULL)
+        return;
+#endif
     g_psHPFDescriptor->PortDescriptors
       = (const LADSPA_PortDescriptor *)piPortDescriptors;
     piPortDescriptors[SF_CUTOFF]
@@ -364,6 +380,10 @@ _init() {
       = LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO;
     pcPortNames
       = (char **)calloc(3, sizeof(char *));
+#ifdef __TIZEN__
+    if (pcPortNames == NULL)
+        return;
+#endif
     g_psHPFDescriptor->PortNames 
       = (const char **)pcPortNames;
     pcPortNames[SF_CUTOFF]
@@ -374,6 +394,10 @@ _init() {
       = strdup("Output");
     psPortRangeHints = ((LADSPA_PortRangeHint *)
                        calloc(3, sizeof(LADSPA_PortRangeHint)));
+#ifdef __TIZEN__
+    if (psPortRangeHints == NULL)
+        return;
+#endif
     g_psHPFDescriptor->PortRangeHints
       = (const LADSPA_PortRangeHint *)psPortRangeHints;
     psPortRangeHints[SF_CUTOFF].HintDescriptor