[vlc-commits] soxr: Fix leak on error

Hugo Beauzée-Luyssen git at videolan.org
Tue Jul 31 14:12:58 CEST 2018


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

soxr: Fix leak on error

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=881a158d5037e9e6f95dbc7484d7b23641a89cf1
---

 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 6a13609e05..4d9254ebef 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