[FFmpeg-cvslog] avfilter/vsrc_life: use av_calloc()

Paul B Mahol git at videolan.org
Sun Sep 15 21:08:49 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Sep 13 09:25:32 2013 +0000| [693747c3d09fbbc3a9b52402bd5597fec7a375c7] | committer: Paul B Mahol

avfilter/vsrc_life: use av_calloc()

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavfilter/vsrc_life.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vsrc_life.c b/libavfilter/vsrc_life.c
index fd82b23..26bd38b 100644
--- a/libavfilter/vsrc_life.c
+++ b/libavfilter/vsrc_life.c
@@ -194,8 +194,8 @@ static int init_pattern_from_file(AVFilterContext *ctx)
         life->h = h;
     }
 
-    if (!(life->buf[0] = av_mallocz(sizeof(char) * life->h * life->w)) ||
-        !(life->buf[1] = av_mallocz(sizeof(char) * life->h * life->w))) {
+    if (!(life->buf[0] = av_calloc(life->h * life->w, sizeof(*life->buf[0]))) ||
+        !(life->buf[1] = av_calloc(life->h * life->w, sizeof(*life->buf[1])))) {
         av_free(life->buf[0]);
         av_free(life->buf[1]);
         return AVERROR(ENOMEM);
@@ -236,8 +236,8 @@ static int init(AVFilterContext *ctx)
         /* fill the grid randomly */
         int i;
 
-        if (!(life->buf[0] = av_mallocz(sizeof(char) * life->h * life->w)) ||
-            !(life->buf[1] = av_mallocz(sizeof(char) * life->h * life->w))) {
+        if (!(life->buf[0] = av_calloc(life->h * life->w, sizeof(*life->buf[0]))) ||
+            !(life->buf[1] = av_calloc(life->h * life->w, sizeof(*life->buf[1])))) {
             av_free(life->buf[0]);
             av_free(life->buf[1]);
             return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list