summaryrefslogtreecommitdiffstats
path: root/video/out/dither.c
diff options
context:
space:
mode:
authorBruno George de Moraes <bruno.gm0@gmail.com>2014-09-04 20:44:51 -0300
committerwm4 <wm4@nowhere>2014-09-05 01:59:11 +0200
commitbca4219dd0c8c1896a19ed5544b40656f5078b1b (patch)
treed01865e2652ca101d6691cb75cae0542f2485bb0 /video/out/dither.c
parenta7d737a6986446ba921690cc985468534ed8caab (diff)
downloadmpv-bca4219dd0c8c1896a19ed5544b40656f5078b1b.tar.bz2
mpv-bca4219dd0c8c1896a19ed5544b40656f5078b1b.tar.xz
malloc+memset(0) to calloc
Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'video/out/dither.c')
-rw-r--r--video/out/dither.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/video/out/dither.c b/video/out/dither.c
index ac3e9f41d6..1fd458b48f 100644
--- a/video/out/dither.c
+++ b/video/out/dither.c
@@ -63,7 +63,6 @@ static void makegauss(struct ctx *k, unsigned int sizeb)
{
assert(sizeb >= 1 && sizeb <= MAX_SIZEB);
- memset(k, 0, sizeof(*k));
av_lfg_init(&k->avlfg, 123);
k->sizeb = sizeb;
@@ -159,7 +158,7 @@ static void makeuniform(struct ctx *k)
// out_matrix is a reactangular tsize * tsize array, where tsize = (1 << size).
void mp_make_fruit_dither_matrix(float *out_matrix, int size)
{
- struct ctx *k = talloc(NULL, struct ctx);
+ struct ctx *k = talloc_zero(NULL, struct ctx);
makegauss(k, size);
makeuniform(k);
float invscale = k->size2;
@@ -225,7 +224,7 @@ static void print(struct ctx *k)
int main(void)
{
mp_time_init();
- struct ctx *k = malloc(sizeof(struct ctx));
+ struct ctx *k = calloc(1,sizeof(struct ctx));
int64_t s = mp_time_us();
makegauss(k, 6);
makeuniform(k);