Bug#248142: This is a gstreamer-flac bug

Matijs van Zuijlen Matijs van Zuijlen <Matijs.van.Zuijlen@xs4all.nl>, 248142@bugs.debian.org
Thu, 27 May 2004 23:06:28 +0200


--i0/AhcQY5QxfSsSZ
Content-Type: multipart/mixed; boundary="NzB8fVQJ5HfG6fxh"
Content-Disposition: inline


--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

reassign 248142 gstreamer-flac
tags 248142 patch
thank you

I have traced this problem to a bug in gstreamer-flac. It turns out it
converts the length of a string to little-endian, and then feeds the
result to g_convert to convert the string to UTF-8.

A patch is attached. It removes the conversion to little-endian.

Note that the other possible solution, leaving the conversion in place
and converting back to a guint32 for the call to g_convert, results in a
crash in libflac. I have tested the resulting flac files (created on
powerpc) on powerpc and x86.

--=20
Matijs van Zuijlen

--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="gst-diff.txt"
Content-Transfer-Encoding: quoted-printable

--- gst-plugins-0.6.4/ext/flac/gstflacenc.c	2004-05-27 20:31:34.000000000 +=
0200
+++ gst-plugins-0.6.4/ext/flac/gstflacenc.c.orig	2004-05-27 23:00:49.000000=
000 +0200
@@ -452,7 +452,7 @@
=20
       data =3D g_strdup_printf("%s=3D%s", name, value);
=20
-      commment_entry.length =3D strlen(data);
+      commment_entry.length =3D GUINT32_TO_LE (strlen(data));
       commment_entry.entry  =3D g_convert (data, commment_entry.length, "U=
TF8", "ISO-8859-1", NULL, NULL, NULL);
=20
       FLAC__metadata_object_vorbiscomment_insert_comment (flacenc->meta[0]=
, comments++, commment_entry, TRUE);

--NzB8fVQJ5HfG6fxh--

--i0/AhcQY5QxfSsSZ
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAtlhTh3TgaXYDPEERAuSrAKCTvS1HDGxHbSbLqKJWpjcXtxDH5wCdE6Si
ueWp9rOPX3iaRjQmo17ayPQ=
=2ffZ
-----END PGP SIGNATURE-----

--i0/AhcQY5QxfSsSZ--