summaryrefslogtreecommitdiffstats
path: root/video/out/vo_x11.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/vo_x11.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/vo_x11.c')
-rw-r--r--video/out/vo_x11.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c
index b3fd88d236..914522e6b8 100644
--- a/video/out/vo_x11.c
+++ b/video/out/vo_x11.c
@@ -212,12 +212,10 @@ shmemerror:
p->myximage[foo] =
XCreateImage(vo->x11->display, p->vinfo.visual, p->depth, ZPixmap,
0, NULL, p->image_width, p->image_height, 8, 0);
- p->ImageDataOrig[foo] =
- malloc(p->myximage[foo]->bytes_per_line * p->image_height + 32);
+ size_t sz = p->myximage[foo]->bytes_per_line * p->image_height + 32;
+ p->ImageDataOrig[foo] = calloc(1, sz);
p->myximage[foo]->data = p->ImageDataOrig[foo] + 16
- ((long)p->ImageDataOrig & 15);
- memset(p->myximage[foo]->data, 0, p->myximage[foo]->bytes_per_line
- * p->image_height);
p->ImageData[foo] = p->myximage[foo]->data;
#if HAVE_SHM && HAVE_XEXT
}