aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-04-21 22:45:12 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-09-26 16:50:41 +0200
commit75eb7a648a8a3336bb884688dcd82f7bd2c6d864 (patch)
treef5c45999c328ce3bacc5a6eadffea5e03743cff2
parent52e229f61126d214f8ec2c0fdeb4ae296dc10950 (diff)
downloadffmpeg-75eb7a648a8a3336bb884688dcd82f7bd2c6d864.tar.gz
avfilter/vsrc_mandelbrot: Check for malloc failure
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit fbd22504c4148d2a01ccfe38df26c144f56db76b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/vsrc_mandelbrot.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavfilter/vsrc_mandelbrot.c b/libavfilter/vsrc_mandelbrot.c
index 761c915103..ed31a23c31 100644
--- a/libavfilter/vsrc_mandelbrot.c
+++ b/libavfilter/vsrc_mandelbrot.c
@@ -134,6 +134,9 @@ static av_cold int init(AVFilterContext *ctx)
s-> next_cache= av_malloc_array(s->cache_allocated, sizeof(*s-> next_cache));
s-> zyklus = av_malloc_array(s->maxiter + 16, sizeof(*s->zyklus));
+ if (!s->point_cache || !s->next_cache || !s->zyklus)
+ return AVERROR(ENOMEM);
+
return 0;
}