Commit 9dde7278 authored by Stéphane Borel's avatar Stéphane Borel

-fixed css authentication under linux since it has been broken for a few

days: we have to initialize agid of authinfo struct.

-fixed a segfault on exit when DVDInit fails
parent e98a5e59
......@@ -2,7 +2,7 @@
* dvd_ioctl.c: DVD ioctl replacement function
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ioctl.c,v 1.7 2001/04/06 09:15:47 sam Exp $
* $Id: dvd_ioctl.c,v 1.8 2001/04/08 09:04:33 stef Exp $
*
* Authors: Markus Kuespert <ltlBeBoy@beosmail.com>
* Samuel Hocevar <sam@zoy.org>
......@@ -216,6 +216,7 @@ int ioctl_LUSendChallenge( css_t *p_css, u8 *p_challenge )
dvd_authinfo auth_info;
auth_info.type = DVD_LU_SEND_CHALLENGE;
auth_info.lsa.agid = p_css->i_agid;
i_ret = ioctl( p_css->i_fd, DVD_AUTH, &auth_info );
......@@ -382,6 +383,7 @@ int ioctl_HostSendChallenge( css_t *p_css, u8 *p_challenge )
dvd_authinfo auth_info;
auth_info.type = DVD_HOST_SEND_CHALLENGE;
auth_info.lsa.agid = p_css->i_agid;
memcpy( auth_info.hsc.chal, p_challenge, sizeof(dvd_challenge) );
......
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.38 2001/04/08 07:24:47 stef Exp $
* $Id: input_dvd.c,v 1.39 2001/04/08 09:04:33 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -742,10 +742,13 @@ static void DVDInit( input_thread_t * p_input )
int i_chapter;
int i;
/* I don't want DVDs to start playing immediately */
// p_input->stream.i_new_status = PAUSE_S;
p_dvd = malloc( sizeof(thread_dvd_data_t) );
if( p_dvd == NULL )
{
intf_ErrMsg( "Out of memory" );
intf_ErrMsg( "dvd error: out of memory" );
p_input->b_error = 1;
return;
}
......@@ -783,7 +786,7 @@ static void DVDInit( input_thread_t * p_input )
/* Ifo initialisation */
if( IfoInit( &p_dvd->p_ifo, p_input->i_handle ) < 0 )
{
intf_ErrMsg( "ifo error: fatal failure" );
intf_ErrMsg( "dvd error: fatal failure in IFO" );
free( p_dvd );
p_input->b_error = 1;
return;
......@@ -795,7 +798,7 @@ static void DVDInit( input_thread_t * p_input )
p_dvd->p_css = malloc( sizeof(css_t) );
if( p_dvd->p_css == NULL )
{
intf_ErrMsg( "css error: couldn't create CSS structure" );
intf_ErrMsg( "dvd error: couldn't create CSS structure" );
free( p_dvd );
p_input->b_error = 1;
return;
......@@ -806,14 +809,14 @@ static void DVDInit( input_thread_t * p_input )
if( CSSInit( p_dvd->p_css ) )
{
intf_ErrMsg( "css error: fatal failure" );
intf_ErrMsg( "dvd error: fatal failure in CSS" );
free( p_dvd->p_css );
free( p_dvd );
p_input->b_error = 1;
return;
}
intf_WarnMsg( 2, "css info: initialized" );
intf_WarnMsg( 2, "dvd info: CSS initialized" );
}
/* Initialize ES structures */
......
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.94 2001/03/19 13:26:59 sam Exp $
* $Id: input.c,v 1.95 2001/04/08 09:04:33 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -345,6 +345,14 @@ static int InitThread( input_thread_t * p_input )
p_input->pf_init( p_input );
if( p_input->b_error )
{
/* We barfed -- exit nicely */
p_input->pf_close( p_input );
module_Unneed( p_main->p_bank, p_input->p_input_module );
return( -1 );
}
*p_input->pi_status = THREAD_READY;
return( 0 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment