X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fkino%2Friff.cc;h=a03f069bd8e6efa7fc2e4c2b49f6d06b959775fb;hb=f7de757c48d3634113f129a3c727656f0cd2ed79;hp=46d78667d51b048e668be2b5bf8d3defb2a61648;hpb=8a31393adc3ce32ea5cc7ff006faead0f5124570;p=melted diff --git a/src/modules/kino/riff.cc b/src/modules/kino/riff.cc index 46d7866..a03f069 100644 --- a/src/modules/kino/riff.cc +++ b/src/modules/kino/riff.cc @@ -21,6 +21,9 @@ * Change log: * * $Log$ +* Revision 1.3 2005/07/25 14:41:29 lilo_booter +* + Minor correction for entry length being less than the data length +* * Revision 1.2 2005/07/25 07:21:39 lilo_booter * + fixes for opendml dv avi * @@ -79,7 +82,9 @@ //#include #include #include +#ifndef __FreeBSD__ #include +#endif /* __FreeBSD__ */ using std::cout; using std::hex; @@ -110,7 +115,7 @@ using std::endl; could not get it working on the gcc compiler so I had to use this workaround. We can now use id = make_fourcc("ABCD") instead. */ -FOURCC make_fourcc( char *s ) +FOURCC make_fourcc( const char *s ) { if ( s[ 0 ] == 0 ) return 0; @@ -622,7 +627,7 @@ void RIFFFile::ReadChunk( int chunk_index, void *data, off_t data_len ) entry = GetDirectoryEntry( chunk_index ); pthread_mutex_lock( &file_mutex ); fail_if( lseek( fd, entry.offset, SEEK_SET ) == ( off_t ) - 1 ); - fail_neg( read( fd, data, data_len ) ); + fail_neg( read( fd, data, entry.length > data_len ? data_len : entry.length ) ); pthread_mutex_unlock( &file_mutex ); }