mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-18 08:56:40 -05:00
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>
This commit is contained in:
parent
47a0171a95
commit
6603ee8563
1 changed files with 3 additions and 1 deletions
|
|
@ -119,8 +119,10 @@ int pa_resampler_ffmpeg_init(pa_resampler *r) {
|
||||||
* internally only uses these hardcoded values, so let's use them
|
* internally only uses these hardcoded values, so let's use them
|
||||||
* here for now as well until ffmpeg makes this configurable. */
|
* 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;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
r->impl.free = ffmpeg_free;
|
r->impl.free = ffmpeg_free;
|
||||||
r->impl.resample = ffmpeg_resample;
|
r->impl.resample = ffmpeg_resample;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue