提交 d8ac258a 编写于 作者: D dmarkov

8230782: Robot.createScreenCapture() fails if ?awt.robot.gtk? is set to false

Reviewed-by: prr, serb
上级 865a472f
......@@ -218,7 +218,11 @@ 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) ) ;
/* JDK modification.
* use calloc instead of malloc to initialize allocated memory
* *src_colors = colors = (XColor *)malloc(ncolors * sizeof(XColor) ) ;
*/
*src_colors = colors = (XColor *)calloc(ncolors, sizeof(XColor));
if(src_vis->class != TrueColor && src_vis->class != DirectColor)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册