[FFmpeg-cvslog] swresample/resample: fix return value of build_filter
Muhammad Faiz
git at videolan.org
Tue Oct 18 18:38:49 EEST 2016
ffmpeg | branch: master | Muhammad Faiz <mfcc64 at gmail.com> | Tue Oct 18 14:13:39 2016 +0700| [acd74f92009df648a6bf4eb9513b38c20d422aeb] | committer: Muhammad Faiz
swresample/resample: fix return value of build_filter
return AVERROR code on error
Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=acd74f92009df648a6bf4eb9513b38c20d422aeb
---
libswresample/resample.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libswresample/resample.c b/libswresample/resample.c
index b834248..8635bf1 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -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 *sin_lut = av_malloc_array(ph_nb, sizeof(*sin_lut));
const int center= (tap_count-1)/2;
+ int ret = AVERROR(ENOMEM);
if (!tab || !sin_lut)
goto fail;
@@ -292,10 +293,11 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
}
#endif
+ ret = 0;
fail:
av_free(tab);
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,
More information about the ffmpeg-cvslog
mailing list