[FFmpeg-cvslog] avfilter/vsrc_mandelbrot: Check for malloc failure

Michael Niedermayer git at videolan.org
Fri Oct 21 23:50:23 EEST 2022


ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Thu Apr 21 22:45:12 2022 +0200| [23ce7312cc77e09140f8b38fa2b7a272bfdbfcf7] | committer: Michael Niedermayer

avfilter/vsrc_mandelbrot: Check for malloc failure

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit fbd22504c4148d2a01ccfe38df26c144f56db76b)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavfilter/vsrc_mandelbrot.c b/libavfilter/vsrc_mandelbrot.c
index 2f6944f02f..2acc8fee52 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;
 }
 



More information about the ffmpeg-cvslog mailing list