[pulseaudio-commits] src/pulsecore

Arun Raghavan arun at kemper.freedesktop.org
Fri May 13 08:55:40 UTC 2016


 src/pulsecore/resampler/ffmpeg.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 6603ee8563760f7a5c09b17da69b54d7e0da490e
Author: Sachin Kumar Chauhan <sachin.kc at samsung.com>
Date:   Fri May 13 14:16:16 2016 +0530

    resampler: Fix a memory leak in pa_resampler_ffmpeg_init()
    
    ffmpeg_data was not freed properly before return due to error.
    It is now freed properly.
    
    BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=95347
    
    Signed-off-by: Sachin Kumar Chauhan <sachin.kc at samsung.com>
    Signed-off-by: Arun Raghavan <arun at arunraghavan.net>

diff --git a/src/pulsecore/resampler/ffmpeg.c b/src/pulsecore/resampler/ffmpeg.c
index 691bdd4..388b555 100644
--- a/src/pulsecore/resampler/ffmpeg.c
+++ b/src/pulsecore/resampler/ffmpeg.c
@@ -119,8 +119,10 @@ int pa_resampler_ffmpeg_init(pa_resampler *r) {
      * internally only uses these hardcoded values, so let's use them
      * here for now as well until ffmpeg makes this configurable. */
 
-    if (!(ffmpeg_data->state = av_resample_init((int) r->o_ss.rate, (int) r->i_ss.rate, 16, 10, 0, 0.8)))
+    if (!(ffmpeg_data->state = av_resample_init((int) r->o_ss.rate, (int) r->i_ss.rate, 16, 10, 0, 0.8))) {
+        pa_xfree(ffmpeg_data);
         return -1;
+    }
 
     r->impl.free = ffmpeg_free;
     r->impl.resample = ffmpeg_resample;



More information about the pulseaudio-commits mailing list