|
Lines 168-184
rfbTranslateNone(ScreenPtr pScreen, char
Link Here
|
| 168 |
{ |
168 |
{ |
| 169 |
VNCSCREENPTR(pScreen); |
169 |
VNCSCREENPTR(pScreen); |
| 170 |
DrawablePtr pDraw = (DrawablePtr)WindowTable[pScreen->myNum]; |
170 |
DrawablePtr pDraw = (DrawablePtr)WindowTable[pScreen->myNum]; |
| 171 |
int truewidth = PixmapBytePad(width, in->bitsPerPixel) / 4; |
171 |
int truewidth = PixmapBytePad(width, in->bitsPerPixel); |
| 172 |
|
172 |
|
| 173 |
if ((x + truewidth > pVNC->width) || truewidth != width) { |
173 |
if ((x + width > pVNC->width) || truewidth != width * in->bitsPerPixel / 8) { |
| 174 |
unsigned char *buffer = malloc(truewidth * height * in->bitsPerPixel / 8); |
174 |
unsigned char *buffer = malloc(truewidth * height); |
| 175 |
unsigned char *buf = buffer; |
175 |
unsigned char *buf = buffer; |
| 176 |
|
176 |
|
| 177 |
(*pScreen->GetImage)(pDraw, x, y, truewidth, height, ZPixmap, ~0, (char*)buf); |
177 |
(*pScreen->GetImage)(pDraw, x, y, width, height, ZPixmap, ~0, (char*)buf); |
| 178 |
while (height--) { |
178 |
while (height--) { |
| 179 |
memcpy(optr, buf, width * in->bitsPerPixel / 8); |
179 |
memcpy(optr, buf, width * in->bitsPerPixel / 8); |
| 180 |
optr += width * in->bitsPerPixel / 8; |
180 |
optr += width * in->bitsPerPixel / 8; |
| 181 |
buf += truewidth * in->bitsPerPixel / 8; |
181 |
buf += truewidth; |
| 182 |
} |
182 |
} |
| 183 |
free(buffer); |
183 |
free(buffer); |
| 184 |
return; |
184 |
return; |