[vlc-devel] [PATCH 03/11] demux: wav: skip header in ChunkFind

Thomas Guillem thomas at gllm.fr
Thu Mar 12 14:56:25 CET 2020


---
 modules/demux/wav.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/modules/demux/wav.c b/modules/demux/wav.c
index 4f483df10c7..6de4b39efec 100644
--- a/modules/demux/wav.c
+++ b/modules/demux/wav.c
@@ -151,6 +151,8 @@ static int ChunkFind( demux_t *p_demux, const char *fcc, unsigned int *pi_size )
             {
                 *pi_size = i_size;
             }
+            if( vlc_stream_Read( p_demux->s, NULL, 8 ) != 8 )
+                return VLC_EGENERIC;
             return VLC_SUCCESS;
         }
 
@@ -301,8 +303,6 @@ static int Open( vlc_object_t * p_this )
             msg_Err( p_demux, "invalid 'ds64' chunk" );
             goto error;
         }
-        if( vlc_stream_Read( p_demux->s, NULL, 8 ) != 8 )
-            goto error;
         if( vlc_stream_Peek( p_demux->s, &p_peek, 24 ) < 24 )
             goto error;
         i_data_size = GetQWLE( &p_peek[8] );
@@ -326,9 +326,6 @@ static int Open( vlc_object_t * p_this )
         msg_Err( p_demux, "invalid 'fmt ' chunk" );
         goto error;
     }
-    if( vlc_stream_Read( p_demux->s, NULL, 8 ) != 8 )
-        goto error;
-
 
     /* load waveformatex */
     p_wf_ext = malloc( i_size );
@@ -566,8 +563,6 @@ static int Open( vlc_object_t * p_this )
         goto error;
     }
 
-    if( vlc_stream_Read( p_demux->s, NULL, 8 ) != 8 )
-        goto error;
     p_sys->i_data_pos = vlc_stream_Tell( p_demux->s );
 
     if( !b_is_rf64 || i_size < UINT32_MAX )
-- 
2.20.1



More information about the vlc-devel mailing list