Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/lib.c
diff options
context:
space:
mode:
authorLuc Trudeau <ltrudeau@twoorioles.com>2020-02-20 23:01:43 +0300
committerLuc Trudeau <ltrudeau@twoorioles.com>2020-02-20 23:01:43 +0300
commit0c88560789b4388cc1d2113110574040606a0b45 (patch)
treea52b11c9739e6240355c1bdd753550fbbac20c24 /src/lib.c
parentbf56afde17cdf40303f8d3ec5bca549bc57866c5 (diff)
Replace malloc+memset(0) with calloc
Diffstat (limited to 'src/lib.c')
-rw-r--r--src/lib.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib.c b/src/lib.c
index 2828c96..a8246e3 100644
--- a/src/lib.c
+++ b/src/lib.c
@@ -148,10 +148,8 @@ COLD int dav1d_open(Dav1dContext **const c_out, const Dav1dSettings *const s) {
memset(c->fc, 0, sizeof(*c->fc) * s->n_frame_threads);
if (c->n_fc > 1) {
c->frame_thread.out_delayed =
- malloc(sizeof(*c->frame_thread.out_delayed) * c->n_fc);
+ calloc(c->n_fc, sizeof(*c->frame_thread.out_delayed));
if (!c->frame_thread.out_delayed) goto error;
- memset(c->frame_thread.out_delayed, 0,
- sizeof(*c->frame_thread.out_delayed) * c->n_fc);
}
for (int n = 0; n < s->n_frame_threads; n++) {
Dav1dFrameContext *const f = &c->fc[n];