*** css.c.orig Fri Aug 29 13:22:36 2008 --- css.c Tue May 26 12:18:19 2009 *************** *** 276,285 **** *****************************************************************************/ int _dvdcss_disckey( dvdcss_t dvdcss ) { ! unsigned char p_buffer[ DVD_DISCKEY_SIZE ]; dvd_key_t p_disc_key; int i; if( GetBusKey( dvdcss ) < 0 ) { return -1; --- 276,289 ---- *****************************************************************************/ int _dvdcss_disckey( dvdcss_t dvdcss ) { ! unsigned char _p_buffer[ DVD_DISCKEY_SIZE * 2 ]; ! unsigned char * p_buffer; dvd_key_t p_disc_key; int i; + p_buffer = (uint8_t *)(((uintptr_t)(&_p_buffer) + + (DVD_DISCKEY_SIZE - 1)) & ~(DVD_DISCKEY_SIZE - 1)); + if( GetBusKey( dvdcss ) < 0 ) { return -1; *************** *** 1433,1439 **** static int CrackTitleKey( dvdcss_t dvdcss, int i_pos, int i_len, dvd_key_t p_titlekey ) { ! uint8_t p_buf[ DVDCSS_BLOCK_SIZE ]; const uint8_t p_packstart[4] = { 0x00, 0x00, 0x01, 0xba }; int i_reads = 0; int i_encrypted = 0; --- 1437,1444 ---- static int CrackTitleKey( dvdcss_t dvdcss, int i_pos, int i_len, dvd_key_t p_titlekey ) { ! uint8_t _p_buf[ DVDCSS_BLOCK_SIZE * 2 ]; ! uint8_t * p_buf; const uint8_t p_packstart[4] = { 0x00, 0x00, 0x01, 0xba }; int i_reads = 0; int i_encrypted = 0; *************** *** 1446,1451 **** --- 1451,1459 ---- i_tries = 0; i_success = 0; + p_buf = (uint8_t *)(((uintptr_t)(&_p_buf) + + (DVDCSS_BLOCK_SIZE - 1)) & ~(DVDCSS_BLOCK_SIZE - 1)); + do { i_ret = dvdcss->pf_seek( dvdcss, i_pos ); *** libdvdcss.c.orig Fri Aug 29 13:22:36 2008 --- libdvdcss.c Fri May 22 14:18:47 2009 *************** *** 401,413 **** /* If the cache is enabled, extract a unique disc ID */ if( psz_cache ) { ! uint8_t p_sector[DVDCSS_BLOCK_SIZE]; char psz_debug[PATH_MAX + 30]; char psz_key[1 + KEY_SIZE * 2 + 1]; char *psz_title; uint8_t *psz_serial; int i; /* We read sector 0. If it starts with 0x000001ba (BE), we are * reading a VOB file, and we should not cache anything. */ --- 401,417 ---- /* If the cache is enabled, extract a unique disc ID */ if( psz_cache ) { ! uint8_t _p_sector[DVDCSS_BLOCK_SIZE * 2]; ! uint8_t * p_sector; char psz_debug[PATH_MAX + 30]; char psz_key[1 + KEY_SIZE * 2 + 1]; char *psz_title; uint8_t *psz_serial; int i; + p_sector = (uint8_t *)(((uintptr_t)(&_p_sector) + + (DVDCSS_BLOCK_SIZE - 1)) & ~(DVDCSS_BLOCK_SIZE - 1)); + /* We read sector 0. If it starts with 0x000001ba (BE), we are * reading a VOB file, and we should not cache anything. */