X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fdemux%2Faiff.c;h=c7fe525e375ea7ca01be31b7c7548cce7956f3d9;hb=9ea586416c5222941e6be69679d700427bdc9603;hp=5dc2ac3c031469f769e3698622828ebd4af19aec;hpb=a90a19a6b0468ea9fedadc27cfc1118d70295263;p=vlc diff --git a/modules/demux/aiff.c b/modules/demux/aiff.c index 5dc2ac3c03..c7fe525e37 100644 --- a/modules/demux/aiff.c +++ b/modules/demux/aiff.c @@ -1,7 +1,7 @@ /***************************************************************************** * aiff.c: Audio Interchange File Format demuxer ***************************************************************************** - * Copyright (C) 2004 VideoLAN + * Copyright (C) 2004 the VideoLAN team * $Id$ * * Authors: Laurent Aimar @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /***************************************************************************** @@ -103,14 +103,9 @@ static int Open( vlc_object_t *p_this ) uint8_t *p_peek; - if( stream_Peek( p_demux->s, &p_peek, 12 ) < 12 ) + if( stream_Peek( p_demux->s, &p_peek, 12 ) < 12 ) return VLC_EGENERIC; + if( strncmp( (char *)&p_peek[0], "FORM", 4 ) || strncmp( (char *)&p_peek[8], "AIFF", 4 ) ) { - msg_Err( p_demux, "cannot peek" ); - return VLC_EGENERIC; - } - if( strncmp( &p_peek[0], "FORM", 4 ) || strncmp( &p_peek[8], "AIFF", 4 ) ) - { - msg_Warn( p_demux, "AIFF module discarded" ); return VLC_EGENERIC; } @@ -139,7 +134,7 @@ static int Open( vlc_object_t *p_this ) msg_Dbg( p_demux, "chunk fcc=%4.4s size=%d", p_peek, i_size ); - if( !strncmp( &p_peek[0], "COMM", 4 ) ) + if( !strncmp( (char *)&p_peek[0], "COMM", 4 ) ) { if( stream_Peek( p_demux->s, &p_peek, 18 + 8 ) < 18 + 8 ) { @@ -154,7 +149,7 @@ static int Open( vlc_object_t *p_this ) msg_Dbg( p_demux, "COMM: channels=%d samples_frames=%d bits=%d rate=%d", GetWBE( &p_peek[8] ), GetDWBE( &p_peek[10] ), GetWBE( &p_peek[14] ), GetF80BE( &p_peek[16] ) ); } - else if( !strncmp( &p_peek[0], "SSND", 4 ) ) + else if( !strncmp( (char *)&p_peek[0], "SSND", 4 ) ) { if( stream_Peek( p_demux->s, &p_peek, 8 + 8 ) < 8 + 8 ) { @@ -163,7 +158,7 @@ static int Open( vlc_object_t *p_this ) } p_sys->i_ssnd_pos = stream_Tell( p_demux->s ); - p_sys->i_ssnd_size= i_size; + p_sys->i_ssnd_size = i_size; p_sys->i_ssnd_offset = GetDWBE( &p_peek[8] ); p_sys->i_ssnd_blocksize = GetDWBE( &p_peek[12] ); @@ -177,7 +172,8 @@ static int Open( vlc_object_t *p_this ) } /* Skip this chunk */ - if( stream_Read( p_demux->s, NULL, i_size + 8 ) != i_size + 8 ) + i_size += 8; + if( stream_Read( p_demux->s, NULL, i_size ) != (int)i_size ) { msg_Warn( p_demux, "incomplete file" ); goto error;