@@ -2629,12 +2629,7 @@ HandleRFBServerMessage(rfbClient* client)
26292629 if (!ReadFromRFBServer (client , ((char * )& msg ) + 1 ,
26302630 sz_rfbResizeFrameBufferMsg - 1 ))
26312631 return FALSE;
2632- client -> width = rfbClientSwap16IfLE (msg .rsfb .framebufferWidth );
2633- client -> height = rfbClientSwap16IfLE (msg .rsfb .framebufferHeigth );
2634- client -> updateRect .x = client -> updateRect .y = 0 ;
2635- client -> updateRect .w = client -> width ;
2636- client -> updateRect .h = client -> height ;
2637- if (!client -> MallocFrameBuffer (client ))
2632+ if (!ResizeClientBuffer (client , rfbClientSwap16IfLE (msg .rsfb .framebufferWidth ), rfbClientSwap16IfLE (msg .rsfb .framebufferHeigth )))
26382633 return FALSE;
26392634
26402635 SendFramebufferUpdateRequest (client , 0 , 0 , client -> width , client -> height , FALSE);
@@ -2647,12 +2642,7 @@ HandleRFBServerMessage(rfbClient* client)
26472642 if (!ReadFromRFBServer (client , ((char * )& msg ) + 1 ,
26482643 sz_rfbPalmVNCReSizeFrameBufferMsg - 1 ))
26492644 return FALSE;
2650- client -> width = rfbClientSwap16IfLE (msg .prsfb .buffer_w );
2651- client -> height = rfbClientSwap16IfLE (msg .prsfb .buffer_h );
2652- client -> updateRect .x = client -> updateRect .y = 0 ;
2653- client -> updateRect .w = client -> width ;
2654- client -> updateRect .h = client -> height ;
2655- if (!client -> MallocFrameBuffer (client ))
2645+ if (!ResizeClientBuffer (client , rfbClientSwap16IfLE (msg .prsfb .buffer_w ), rfbClientSwap16IfLE (msg .prsfb .buffer_h )))
26562646 return FALSE;
26572647 SendFramebufferUpdateRequest (client , 0 , 0 , client -> width , client -> height , FALSE);
26582648 rfbClientLog ("Got new framebuffer size: %dx%d\n" , client -> width , client -> height );
0 commit comments