summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2019-09-23 08:25:19 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2019-09-23 08:25:19 -0700
commit8026ace54250eba699ad9979586e78d27a7745dc (patch)
tree3ff40914392988cbb1370de43fde55afa5fe353a
parent9fe45abd6589dcc501e415926d8aaa3568fb1933 (diff)
QueryColorMap() function in multiVis.c may retrieve incorrect colours (#3)
Fixes: https://gitlab.freedesktop.org/xorg/app/xwd/issues/3 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--multiVis.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/multiVis.c b/multiVis.c
index 86e9634..9794ebd 100644
--- a/multiVis.c
+++ b/multiVis.c
@@ -189,7 +189,7 @@ QueryColorMap(Display *disp, Colormap src_cmap, Visual *src_vis,
XColor *colors ;
ncolors = (unsigned) src_vis->map_entries ;
- *src_colors = colors = (XColor *)malloc(ncolors * sizeof(XColor) ) ;
+ *src_colors = colors = calloc(ncolors, sizeof(XColor));
if(src_vis->class != TrueColor && src_vis->class != DirectColor)
{