shithub: libdvdcss

Download patch

ref: 8594af8c56bfcafd200ec6b26192d8d6941e1816
parent: 0833399b2fa6595bd9f64e8b787fd7b5d63bbf06
author: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
date: Sat Sep 25 10:21:47 EDT 2010

Ensure dvdcss->css.p_disc_key is always initialized
even if _dvdcss_disckey fails.


--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -389,6 +389,7 @@
         }
     }
 
+    memset( dvdcss->css.p_disc_key, 0, KEY_SIZE );
     /* If disc is CSS protected and the ioctls work, authenticate the drive */
     if( dvdcss->b_scrambled && dvdcss->b_ioctls )
     {
@@ -398,10 +399,6 @@
         {
             print_debug( dvdcss, "could not get disc key" );
         }
-    }
-    else
-    {
-        memset( dvdcss->css.p_disc_key, 0, KEY_SIZE );
     }
 
     /* If the cache is enabled, write the cache directory tag */