From cd70eeac224c025b8ef0bd8db7a9335e9ef4cabd Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Thu, 28 Nov 2002 18:35:19 +0000 Subject: [PATCH] * asf: fix my previous commit. --- modules/demux/asf/asf.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c index f52ea3f9b3..7bbda92a3f 100644 --- a/modules/demux/asf/asf.c +++ b/modules/demux/asf/asf.c @@ -2,7 +2,7 @@ * asf.c : ASFv01 file input module for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: asf.c,v 1.9 2002/11/28 16:32:29 fenrir Exp $ + * $Id: asf.c,v 1.10 2002/11/28 18:35:19 fenrir Exp $ * Authors: Laurent Aimar * * This program is free software; you can redistribute it and/or modify @@ -255,7 +255,8 @@ static int Activate( vlc_object_t * p_this ) p_wf->nAvgBytesPerSec = GetDWLE( p_data + 8 ); p_wf->nBlockAlign = GetWLE( p_data + 12 ); p_wf->wBitsPerSample = GetWLE( p_data + 14 ); - p_wf->cbSize = i_size - sizeof( WAVEFORMATEX ); + p_wf->cbSize = __MAX( 0, + i_size - sizeof( WAVEFORMATEX )); if( i_size > sizeof( WAVEFORMATEX ) ) { memcpy( (uint8_t*)p_stream->p_es->p_demux_data + sizeof( WAVEFORMATEX ), @@ -275,10 +276,10 @@ static int Activate( vlc_object_t * p_this ) if( p_sp->p_type_specific_data ) { p_stream->p_es->i_fourcc = - VLC_FOURCC( p_sp->p_type_specific_data + 27, - p_sp->p_type_specific_data + 28, - p_sp->p_type_specific_data + 29, - p_sp->p_type_specific_data + 30 ); + VLC_FOURCC( p_sp->p_type_specific_data[27], + p_sp->p_type_specific_data[28], + p_sp->p_type_specific_data[29], + p_sp->p_type_specific_data[30] ); } else { -- 2.39.2