diff options
Diffstat (limited to 'x11vnc/screen.c')
-rw-r--r-- | x11vnc/screen.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/x11vnc/screen.c b/x11vnc/screen.c index 45e951d..57244a5 100644 --- a/x11vnc/screen.c +++ b/x11vnc/screen.c @@ -2033,6 +2033,23 @@ void initialize_screen(int *argc, char **argv, XImage *fb) { } } +#ifndef NO_NCACHE + if (ncache > 0) { + char *new_fb; + int sz = fb->height * fb->bytes_per_line; + + new_fb = (char *) calloc((size_t) (sz * (1+ncache)), 1); + if (fb->data) { + memcpy(new_fb, fb->data, sz); + free(fb->data); + } + fb->data = new_fb; + fb->height *= (1+ncache); + height *= (1+ncache); + ncache0 = ncache; + } +#endif + if (cmap8to24 && depth == 8) { rfb_bytes_per_line *= 4; rot_bytes_per_line *= 4; |