taglib: Don't convert base64 strings to UTF8
authorHugo Beauzée-Luyssen <hugo@beauzee.fr>
Mon, 13 Sep 2021 10:08:53 +0000 (12:08 +0200)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 21 Jan 2025 18:02:47 +0000 (19:02 +0100)
The convertion will incur a cost which we don't want to pay since the
art needs to be encoded in base64, which doesn't include anything
outside of ASCII

(cherry picked from commit 65dfe0cdc97bbb98ad34a690989636d40f326e32)

Gbp-Pq: Name 0044-taglib-Don-t-convert-base64-strings-to-UTF8.patch

modules/meta_engine/taglib.cpp

index a48e102b37dff427a61c8a260d532265e1484f66..256e8e4d3a2921126f2bd74f92da4b9008bb8803 100644 (file)
@@ -800,7 +800,7 @@ static void ReadMetaFromXiph( Ogg::XiphComment* tag, demux_meta_t* p_demux_meta,
         const char* psz_description = "cover";
 
         uint8_t *p_data;
-        int i_data = vlc_b64_decode_binary( &p_data, art_list[0].toCString(true) );
+        int i_data = vlc_b64_decode_binary( &p_data, art_list[0].toCString(false) );
 
         msg_Dbg( p_demux_meta, "Found embedded art: %s (%s) is %i bytes",
                 psz_name, psz_mime, i_data );
@@ -818,7 +818,7 @@ static void ReadMetaFromXiph( Ogg::XiphComment* tag, demux_meta_t* p_demux_meta,
         uint8_t *p_data;
         int i_cover_score;
         int i_cover_idx;
-        int i_data = vlc_b64_decode_binary( &p_data, block_picture_list[0].toCString(true) );
+        int i_data = vlc_b64_decode_binary( &p_data, block_picture_list[0].toCString(false) );
         i_cover_score = i_cover_idx = 0;
         /* TODO: Use i_cover_score / i_cover_idx to select the picture. */
         p_attachment = ParseFlacPicture( p_data, i_data, 0,