[vlc-commits] soxr: Fix leak on error

Hugo Beauzée-Luyssen git at videolan.org
Wed Aug 1 13:19:05 CEST 2018


vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Jul 31 14:09:41 2018 +0200| [0f684e532b12af7e50c449637d372fae7acc3562] | committer: Hugo Beauzée-Luyssen

soxr: Fix leak on error

(cherry picked from commit 881a158d5037e9e6f95dbc7484d7b23641a89cf1)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=0f684e532b12af7e50c449637d372fae7acc3562
---

 modules/audio_filter/resampler/soxr.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/audio_filter/resampler/soxr.c b/modules/audio_filter/resampler/soxr.c
index 2db9921a5a..87538fbf43 100644
--- a/modules/audio_filter/resampler/soxr.c
+++ b/modules/audio_filter/resampler/soxr.c
@@ -336,7 +336,7 @@ Resample( filter_t *p_filter, block_t *p_in )
             assert( !p_out );
             p_out = SoXR_Resample( p_filter, soxr, p_in, i_olen );
             if( !p_out )
-                return NULL;
+                goto error;
         }
 
         if( p_flushed_out )
@@ -348,7 +348,7 @@ Resample( filter_t *p_filter, block_t *p_in )
             block_ChainAppend( &p_flushed_out, p_out );
             p_out = block_ChainGather( p_flushed_out );
             if( !p_out )
-                return NULL;
+                goto error;
             p_out->i_nb_samples = i_nb_samples;
         }
         p_out->i_pts = i_pts;
@@ -365,6 +365,9 @@ Resample( filter_t *p_filter, block_t *p_in )
             p_out->i_pts = i_pts;
         return p_out;
     }
+error:
+    block_Release( p_in );
+    return NULL;
 }
 
 static block_t *



More information about the vlc-commits mailing list