mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
st/xlib Fix XIMage bytes-per-pixel calculation
Fixes a crash seen while running gnome on a 16-bit screen over vnc.
NOTE: This is a candidate for stable release branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
(cherry picked from commit 876fefe2ff)
This commit is contained in:
parent
307a703c75
commit
2cfc0072a8
1 changed files with 2 additions and 3 deletions
|
|
@ -1392,9 +1392,8 @@ XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
|
|||
return;
|
||||
}
|
||||
|
||||
/* The pipe transfer has a pitch rounded up to the nearest 64 pixels.
|
||||
We assume 32 bit pixels. */
|
||||
ximage_stride = w * 4;
|
||||
/* The pipe transfer has a pitch rounded up to the nearest 64 pixels. */
|
||||
ximage_stride = w * ((img->bits_per_pixel + 7) / 8);
|
||||
|
||||
for (line = 0; line < h; line++)
|
||||
memcpy(&map[line * tex_xfer->stride],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue