[vlc-commits] access: vnc: use video_format_Init/Clean

Francois Cartegnie git at videolan.org
Mon Nov 21 21:23:03 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Nov 21 20:31:19 2016 +0100| [25b37b0c07e3dcab8384bbcecfeb479d3c145131] | committer: Francois Cartegnie

access: vnc: use video_format_Init/Clean

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=25b37b0c07e3dcab8384bbcecfeb479d3c145131
---

 modules/access/vnc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/access/vnc.c b/modules/access/vnc.c
index 9a81f03..c8eca5b 100644
--- a/modules/access/vnc.c
+++ b/modules/access/vnc.c
@@ -167,8 +167,7 @@ static rfbBool mallocFrameBufferHandler( rfbClient* p_client )
     if ( i_chroma != VLC_CODEC_RGB8 ) /* Palette based, no mask */
     {
         video_format_t videofmt;
-        memset( &videofmt, 0, sizeof(video_format_t) );
-        videofmt.i_chroma = i_chroma;
+        video_format_Init( &videofmt, i_chroma );
         video_format_FixRgb( &videofmt );
 
         p_client->format.redShift = videofmt.i_lrshift;
@@ -177,6 +176,7 @@ static rfbBool mallocFrameBufferHandler( rfbClient* p_client )
         p_client->format.redMax = videofmt.i_rmask >> videofmt.i_lrshift;
         p_client->format.greenMax = videofmt.i_gmask >> videofmt.i_lgshift;
         p_client->format.blueMax = videofmt.i_bmask >> videofmt.i_lbshift;
+        video_format_Clean( &videofmt );
     }
 
     /* Set up framebuffer */



More information about the vlc-commits mailing list