Skip to content
Snippets Groups Projects
Commit acd74f92 authored by Muhammad Faiz's avatar Muhammad Faiz
Browse files

swresample/resample: fix return value of build_filter


return AVERROR code on error

Signed-off-by: default avatarMuhammad Faiz <mfcc64@gmail.com>
parent 9545ff3e
No related branches found
No related tags found
No related merge requests found
...@@ -149,6 +149,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap ...@@ -149,6 +149,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
double *tab = av_malloc_array(tap_count+1, sizeof(*tab)); double *tab = av_malloc_array(tap_count+1, sizeof(*tab));
double *sin_lut = av_malloc_array(ph_nb, sizeof(*sin_lut)); double *sin_lut = av_malloc_array(ph_nb, sizeof(*sin_lut));
const int center= (tap_count-1)/2; const int center= (tap_count-1)/2;
int ret = AVERROR(ENOMEM);
if (!tab || !sin_lut) if (!tab || !sin_lut)
goto fail; goto fail;
...@@ -292,10 +293,11 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap ...@@ -292,10 +293,11 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
} }
#endif #endif
ret = 0;
fail: fail:
av_free(tab); av_free(tab);
av_free(sin_lut); av_free(sin_lut);
return 0; return ret;
} }
static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment