Fix video output via VNC.

This commit is contained in:
OBattler
2022-12-30 04:29:56 +01:00
parent 4cc21ee2db
commit 06a7e00af4

View File

@@ -160,20 +160,15 @@ vnc_display(rfbClientPtr cl)
static void static void
vnc_blit(int x, int y, int w, int h, int monitor_index) vnc_blit(int x, int y, int w, int h, int monitor_index)
{ {
uint32_t *p; int row;
int yy;
if (monitor_index || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL)) { if (monitor_index || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL)) {
video_blit_complete_monitor(monitor_index); video_blit_complete_monitor(monitor_index);
return; return;
} }
for (yy = 0; yy < h; yy++) { for (row = 0; row < h; ++row)
p = (uint32_t *) &(((uint32_t *) rfb->frameBuffer)[yy * VNC_MAX_X]); video_copy(&(((uint8_t *) rfb->frameBuffer)[row * 2048 * sizeof(uint32_t)]), &(buffer32->line[y + row][x]), w * sizeof(uint32_t));
if ((y + yy) >= 0 && (y + yy) < VNC_MAX_Y)
video_copy(p, &(buffer32->line[yy]), w * sizeof(uint32_t));
}
if (screenshots) if (screenshots)
video_screenshot((uint32_t *) rfb->frameBuffer, 0, 0, VNC_MAX_X); video_screenshot((uint32_t *) rfb->frameBuffer, 0, 0, VNC_MAX_X);