Commit 99722c93 authored by Sam Hocevar's avatar Sam Hocevar

  * Damn recursion! Fixed an infinite loop in libdvdcss.
parent 0bb015ee
......@@ -2,7 +2,7 @@
* css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: css.c,v 1.15 2001/11/12 20:16:32 sam Exp $
* $Id: css.c,v 1.16 2001/11/13 02:03:46 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
* Hkan Hjort <d95hjort@dtek.chalmers.se>
......@@ -386,8 +386,8 @@ int CSSGetTitleKey( dvdcss_handle dvdcss, int i_pos )
do
{
i_pos = dvdcss_seek( dvdcss, i_pos, DVDCSS_NOFLAGS );
if( dvdcss_read( dvdcss, p_buf, 1, DVDCSS_NOFLAGS ) != 1 ) break;
i_pos = _dvdcss_seek( dvdcss, i_pos );
if( _dvdcss_read( dvdcss, p_buf, 1 ) != 1 ) break;
/* Stop when we find a non MPEG stream block */
if( memcmp( p_buf, p_packstart, 4 ) )
......
......@@ -2,7 +2,7 @@
* libdvdcss.c: DVD reading library.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: libdvdcss.c,v 1.20 2001/11/13 01:25:05 sam Exp $
* $Id: libdvdcss.c,v 1.21 2001/11/13 02:03:46 sam Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -61,8 +61,6 @@
*****************************************************************************/
static int _dvdcss_open ( dvdcss_handle, char *psz_target );
static int _dvdcss_close ( dvdcss_handle );
static int _dvdcss_seek ( dvdcss_handle, int i_blocks );
static int _dvdcss_read ( dvdcss_handle, void *p_buffer, int i_blocks );
static int _dvdcss_readv ( dvdcss_handle, struct iovec *p_iovec, int i_blocks );
/*****************************************************************************
......@@ -499,7 +497,7 @@ static int _dvdcss_close ( dvdcss_handle dvdcss )
return 0;
}
static int _dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks )
int _dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks )
{
#if defined( WIN32 )
dvdcss->i_seekpos = i_blocks;
......@@ -543,7 +541,7 @@ static int _dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks )
}
static int _dvdcss_read ( dvdcss_handle dvdcss, void *p_buffer, int i_blocks )
int _dvdcss_read ( dvdcss_handle dvdcss, void *p_buffer, int i_blocks )
{
#if defined( WIN32 )
if( WIN2K )
......
......@@ -2,7 +2,7 @@
* private.h: private DVD reading library data
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: libdvdcss.h,v 1.9 2001/11/12 20:16:33 sam Exp $
* $Id: libdvdcss.h,v 1.10 2001/11/13 02:03:46 sam Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -61,6 +61,12 @@ struct dvdcss_s
#define DVDCSS_METHOD_DISC 1
#define DVDCSS_METHOD_TITLE 2
/*****************************************************************************
* Functions used across the library
*****************************************************************************/
int _dvdcss_seek ( dvdcss_handle, int i_blocks );
int _dvdcss_read ( dvdcss_handle, void *p_buffer, int i_blocks );
/*****************************************************************************
* Error management
*****************************************************************************/
......
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