Commit 693747c3 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vsrc_life: use av_calloc()

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 4f1a17b1
...@@ -194,8 +194,8 @@ static int init_pattern_from_file(AVFilterContext *ctx) ...@@ -194,8 +194,8 @@ static int init_pattern_from_file(AVFilterContext *ctx)
life->h = h; life->h = h;
} }
if (!(life->buf[0] = 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_mallocz(sizeof(char) * life->h * life->w))) { !(life->buf[1] = av_calloc(life->h * life->w, sizeof(*life->buf[1])))) {
av_free(life->buf[0]); av_free(life->buf[0]);
av_free(life->buf[1]); av_free(life->buf[1]);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
...@@ -236,8 +236,8 @@ static int init(AVFilterContext *ctx) ...@@ -236,8 +236,8 @@ static int init(AVFilterContext *ctx)
/* fill the grid randomly */ /* fill the grid randomly */
int i; int i;
if (!(life->buf[0] = 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_mallocz(sizeof(char) * life->h * life->w))) { !(life->buf[1] = av_calloc(life->h * life->w, sizeof(*life->buf[1])))) {
av_free(life->buf[0]); av_free(life->buf[0]);
av_free(life->buf[1]); av_free(life->buf[1]);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment