[vlc-commits] demux: wav: check implicit duration
Francois Cartegnie
git at videolan.org
Wed Dec 5 10:32:57 CET 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Dec 5 10:31:25 2018 +0100| [c90692ebd00fd21b4a9d53e17f2fc7dbf4a215db] | committer: Francois Cartegnie
demux: wav: check implicit duration
fixes truncated files duration
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c90692ebd00fd21b4a9d53e17f2fc7dbf4a215db
---
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 af1ae4beb0..c01e7fd3c6 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