XPutImage() Seg Fault

Glynn Clements glynn at gclements.plus.com
Tue Jan 27 07:38:34 PST 2015

Richard Overstreet wrote:

>  displaydata = (unsigned char *)calloc(ROWS*COLS*2, sizeof(unsigned char));
> Picture=XCreateImage(Monitor,DefaultVisual(Monitor,0),
>         DefaultDepth(Monitor,0),

Is the display depth actually 16 bpp? If it's 32 bpp, the XPutImage
call will try to copy twice as much data as you've allocated, which
may well result in a segfault.

Glynn Clements <glynn at gclements.plus.com>

More information about the xorg mailing list