Fix coverity issue (Uninitialized pointer read) 29/294429/1 accepted/tizen_8.0_unified accepted/tizen_9.0_unified accepted/tizen_unified accepted/tizen_unified_dev tizen tizen_8.0 tizen_9.0 accepted/tizen/8.0/unified/20231005.095517 accepted/tizen/9.0/unified/20241030.232528 accepted/tizen/unified/20230629.132050 accepted/tizen/unified/dev/20230726.115318 tizen_8.0_m2_release tizen_9.0_m2_release
authorJaechul Lee <jcsing.lee@samsung.com>
Mon, 19 Jun 2023 06:18:35 +0000 (15:18 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Mon, 19 Jun 2023 06:18:35 +0000 (15:18 +0900)
[Version] 0.0.4
[Issue Type] Coverity

Change-Id: Ibc940271aab502ed155c67036daac2cf3c6a72aa
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
packaging/rnnoise.spec
src/kiss_fft.c

index 96a9937..275cc78 100644 (file)
@@ -1,7 +1,7 @@
 %global date 20210312
 Name:       rnnoise
 Version:    0
-Release:    0.3
+Release:    0.4
 Summary:    Recurrent neural network for audio noise reduction
 License:    BSD-3-Clause
 URL:        https://gitlab.xiph.org/xiph/rnnoise
@@ -27,7 +27,7 @@ Requires:   %{name}%{?_isa} = %{version}-%{release}
 Devel files for %{name}.
 
 %prep
-%autosetup -n %{name}-%{version}.%{date} -p1
+%setup -q
 cp %{SOURCE1} .
 
 cat > 'package_version' <<-EOF
index d6b9f26..033cea0 100644 (file)
@@ -449,6 +449,7 @@ kiss_fft_state *opus_fft_alloc_twiddles(int nfft,void * mem,size_t * lenmem,
         kiss_twiddle_cpx *twiddles;
 
         st->nfft=nfft;
+        st->bitrev = NULL;
 #ifdef FIXED_POINT
         st->scale_shift = celt_ilog2(st->nfft);
         if (st->nfft == 1<<st->scale_shift)
@@ -506,7 +507,8 @@ void opus_fft_free(const kiss_fft_state *cfg, int arch)
    if (cfg)
    {
       opus_fft_free_arch((kiss_fft_state *)cfg, arch);
-      opus_free((opus_int16*)cfg->bitrev);
+      if (cfg->bitrev)
+         opus_free((opus_int16*)cfg->bitrev);
       if (cfg->shift < 0)
          opus_free((kiss_twiddle_cpx*)cfg->twiddles);
       opus_free((kiss_fft_state*)cfg);