r1234 - trunk/libdvdread/src/dvd_udf.c
Author: rathann Date: Thu Oct 6 14:10:01 2011 New Revision: 1234 Log: Fix segfault when reading certain DVDs, for example "Thor". This results from a new anti-copy scheme where the real video_ts.ifo is hidden. Use of the decoy video_ts.ifo results in a unplayable DVD. Patch by Alexander Roalter \alex!roalter*it/. Verified by John Stebbins |stebbins%jethaddev&com|. Modified: trunk/libdvdread/src/dvd_udf.c Modified: trunk/libdvdread/src/dvd_udf.c ============================================================================== --- trunk/libdvdread/src/dvd_udf.c Sat Aug 13 19:28:48 2011 (r1233) +++ trunk/libdvdread/src/dvd_udf.c Thu Oct 6 14:10:01 2011 (r1234) @@ -329,16 +329,17 @@ static int SetUDFCache(dvd_reader_t *dev static int Unicodedecode( uint8_t *data, int len, char *target ) { int p = 1, i = 0; + int err = 0; if( ( data[ 0 ] == 8 ) || ( data[ 0 ] == 16 ) ) do { - if( data[ 0 ] == 16 ) p++; /* Ignore MSB of unicode16 */ + if( data[ 0 ] == 16 ) err |= data[p++]; /* character cannot be converted to 8bit, return error */ if( p < len ) { target[ i++ ] = data[ p++ ]; } } while( p < len ); target[ i ] = '\0'; - return 0; + return !err; } static int UDFDescriptor( uint8_t *data, uint16_t *TagID ) @@ -490,8 +491,9 @@ static int UDFFileIdentifier( uint8_t *d L_FI = GETN1(19); UDFLongAD(&data[20], FileICB); L_IU = GETN2(36); - if (L_FI) Unicodedecode(&data[38 + L_IU], L_FI, FileName); - else FileName[0] = '\0'; + if (L_FI) { + if (!Unicodedecode(&data[38 + L_IU], L_FI, FileName)) FileName[0] = 0; + } else FileName[0] = '\0'; return 4 * ((38 + L_FI + L_IU + 3) / 4); }
On Thu, Oct 06, 2011 at 02:10:02PM +0200, rathann wrote :
Fix segfault when reading certain DVDs, for example "Thor".
Would it be possible to have a release after that commit? Even a micro one would be cool. Best Regards, -- Jean-Baptiste Kempf http://www.jbkempf.com/ - +33 672 704 734 Sent from my Electronic Device
On Thursday, 06 October 2011 at 14:30, Jean-Baptiste Kempf wrote:
On Thu, Oct 06, 2011 at 02:10:02PM +0200, rathann wrote :
Fix segfault when reading certain DVDs, for example "Thor".
Would it be possible to have a release after that commit? Even a micro one would be cool.
Yes, that's what I'm aiming for. Regards, Dominik -- Fedora http://fedoraproject.org/wiki/User:Rathann RPMFusion http://rpmfusion.org | MPlayer http://mplayerhq.hu "Faith manages." -- Delenn to Lennier in Babylon 5:"Confessions and Lamentations"
participants (3)
-
Dominik 'Rathann' Mierzejewski -
Jean-Baptiste Kempf -
rathann