[vlc-commits] meta_engine: taglib: restrict unlimited reads on streams
Francois Cartegnie
git at videolan.org
Tue Aug 11 16:23:00 CEST 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Aug 10 14:55:02 2020 +0200| [8ec8b0d2add84b6d6b0c043e1c4f241998915ecd] | committer: Francois Cartegnie
meta_engine: taglib: restrict unlimited reads on streams
taglib reads unlimited if no IDv3 or MPEG header is found at the
beginning.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8ec8b0d2add84b6d6b0c043e1c4f241998915ecd
---
modules/meta_engine/taglib.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index 975a971ee1..751e9ded97 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -885,7 +885,14 @@ static int ReadMeta( vlc_object_t* p_this)
p_stream = p_filter;
VlcIostream s( p_stream );
- f = FileRef( &s );
+#ifndef VLC_PATCHED_TAGLIB_ID3V2_READSTYLE
+ uint64_t dummy;
+ if( vlc_stream_GetSize( p_stream, &dummy ) != VLC_SUCCESS )
+ s.setMaxSequentialRead( 2048 );
+ else
+ s.setMaxSequentialRead( 1024 * 2048 );
+#endif
+ f = FileRef( &s, false, AudioProperties::ReadStyle::Fast );
if( f.isNull() )
return VLC_EGENERIC;
More information about the vlc-commits
mailing list