From a9050e77e9511bc171de477a5c8d814065d15d1e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Cartegnie?= Date: Mon, 10 Aug 2020 14:55:02 +0200 Subject: [PATCH] meta_engine: taglib: restrict unlimited reads on streams taglib reads unlimited if no IDv3 or MPEG header is found at the beginning. (cherry picked from commit 8ec8b0d2add84b6d6b0c043e1c4f241998915ecd) (rebased) rebased: - only used with Taglib 1.11+ which is not always the case with 3.0 Gbp-Pq: Name 0041-meta_engine-taglib-restrict-unlimited-reads-on-strea.patch --- 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 a52c67c9..0b7b5820 100644 --- a/modules/meta_engine/taglib.cpp +++ b/modules/meta_engine/taglib.cpp @@ -946,7 +946,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 ); #else // !TAGLIB_VERSION_1_11 char *psz_path = vlc_uri2path( psz_uri ); free( psz_uri ); -- 2.30.2