[libdvdcss-devel] [PATCH] Always initialize readv temporary buffer.
    Hannes Domani 
    ssbssa at yahoo.de
       
    Fri Jul 24 17:15:39 CEST 2015
    
    
  
---
 src/device.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/device.c b/src/device.c
index 98ecbe3..af735e0 100644
--- a/src/device.c
+++ b/src/device.c
@@ -350,6 +350,12 @@ int dvdcss_open_device ( dvdcss_t dvdcss )
     }
     print_debug( dvdcss, "opening target `%s'", psz_device );
 
+#if defined( _WIN32 )
+    /* Initialize readv temporary buffer */
+    dvdcss->p_readv_buffer   = NULL;
+    dvdcss->i_readv_buf_size = 0;
+#endif
+
     /* if callback functions are initialized */
     if( dvdcss->p_stream )
     {
@@ -367,10 +373,6 @@ int dvdcss_open_device ( dvdcss_t dvdcss )
        (!psz_device[2] || (psz_device[2] == '\\' && !psz_device[3])))
         dvdcss->b_file = 0;
 
-    /* Initialize readv temporary buffer */
-    dvdcss->p_readv_buffer   = NULL;
-    dvdcss->i_readv_buf_size = 0;
-
     if( !dvdcss->b_file )
     {
         print_debug( dvdcss, "using Win2K API for access" );
-- 
2.4.6
    
    
More information about the libdvdcss-devel
mailing list