[vlc-commits] demux: wav: check implicit duration

Francois Cartegnie git at videolan.org
Wed Dec 12 11:24:07 CET 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Dec  5 10:31:25 2018 +0100| [05d63bb286e1043ee23dd4326bfd21f068e6fe63] | committer: Francois Cartegnie

demux: wav: check implicit duration

fixes truncated files duration

(cherry picked from commit c90692ebd00fd21b4a9d53e17f2fc7dbf4a215db)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=05d63bb286e1043ee23dd4326bfd21f068e6fe63
---

 modules/demux/wav.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/demux/wav.c b/modules/demux/wav.c
index ab94767f06..9f5e8a9fa8 100644
--- a/modules/demux/wav.c
+++ b/modules/demux/wav.c
@@ -412,7 +412,12 @@ static int Open( vlc_object_t * p_this )
         goto error;
     }
     if( !b_is_rf64 || i_size < UINT32_MAX )
-        p_sys->i_data_size = i_size;
+    {
+        int64_t i_stream_size = stream_Size( p_demux->s );
+        if( i_stream_size > 0 && i_stream_size >= i_size + p_sys->i_data_pos )
+            p_sys->i_data_size = i_size;
+    }
+
     if( vlc_stream_Read( p_demux->s, NULL, 8 ) != 8 )
         goto error;
     p_sys->i_data_pos = vlc_stream_Tell( p_demux->s );



More information about the vlc-commits mailing list