* asf: fix my previous commit.
authorLaurent Aimar <fenrir@videolan.org>
Thu, 28 Nov 2002 18:35:19 +0000 (18:35 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Thu, 28 Nov 2002 18:35:19 +0000 (18:35 +0000)
modules/demux/asf/asf.c

index f52ea3f..7bbda92 100644 (file)
@@ -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 <fenrir@via.ecp.fr>
  * 
  * 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
             {