summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSachin Kumar Chauhan <sachin.kc@samsung.com>2016-05-13 14:16:16 +0530
committerArun Raghavan <arun@arunraghavan.net>2016-05-13 14:22:47 +0530
commit6603ee8563760f7a5c09b17da69b54d7e0da490e (patch)
tree2f56731867c899b324eff9aac2800e503c9abb4d
parent47a0171a9556a83f49db759e20ce8572621bb50c (diff)
downloadpulseaudio-6603ee8563760f7a5c09b17da69b54d7e0da490e.tar.gz
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@samsung.com> Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
-rw-r--r--src/pulsecore/resampler/ffmpeg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pulsecore/resampler/ffmpeg.c b/src/pulsecore/resampler/ffmpeg.c
index 691bdd4b4..388b555af 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;