From: François Cartegnie Date: Mon, 10 Aug 2020 12:55:02 +0000 (+0200) Subject: meta_engine: taglib: restrict unlimited reads on streams X-Git-Tag: archive/raspbian/3.0.21-6+rpi1^2~84 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a9050e77e9511bc171de477a5c8d814065d15d1e;p=vlc.git 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 --- 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 );