[FFmpeg-cvslog] avfilter/asrc_sinc: check allocation return value

Paul B Mahol git at videolan.org
Fri Mar 4 00:08:32 EET 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Mar  3 22:54:33 2022 +0100| [99f7f4144aa644b0d26dae6efe9ac81ba252cb1a] | committer: Paul B Mahol

avfilter/asrc_sinc: check allocation return value

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=99f7f4144aa644b0d26dae6efe9ac81ba252cb1a
---

 libavfilter/asrc_sinc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/asrc_sinc.c b/libavfilter/asrc_sinc.c
index e64a1e2f1c..1218696b27 100644
--- a/libavfilter/asrc_sinc.c
+++ b/libavfilter/asrc_sinc.c
@@ -113,6 +113,9 @@ static float *make_lpf(int num_taps, float Fc, float beta, float rho,
     float *h = av_calloc(num_taps, sizeof(*h)), sum = 0;
     float mult = scale / bessel_I_0(beta), mult1 = 1.f / (.5f * m + rho);
 
+    if (!h)
+        return NULL;
+
     av_assert0(Fc >= 0 && Fc <= 1);
 
     for (i = 0; i <= m / 2; i++) {



More information about the ffmpeg-cvslog mailing list