[gstreamer-bugs] [Bug 584455] [flacenc] sometimes writes broken flac files

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Mon Jun 1 16:52:50 PDT 2009


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=584455

  GStreamer | gst-plugins-good | Ver: git

Tim-Philipp Müller changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |t.i.m at zen.co.uk
            Summary|flacenc sometimes writes    |[flacenc] sometimes writes
                   |broken flac files           |broken flac files




------- Comment #6 from Tim-Philipp Müller  2009-06-01 23:52 UTC -------
Your fix seems to make things work fine for me, so I guess we can close this
now, can't we?

It looks to me like there's an admittedly somewhat obscure bug in libFLAC here.
The bitwriter doesn't seem to zero out bits it's not meant to write in all
cases, and _set_total_samples_estimate() doesn't seem to ensure that the input
isn't too large either, which leads to the possibility of a bit being set in
the wrong place where it shouldn't be set (viz. in the bits_per_sample field in
the stream info header). Filed a bug against FLAC, in case they want to fix
this.

Committed this as well now, to guard against bogus values from upstream (don't
really want that to mess up the file, do we?):

diff --git a/ext/flac/gstflacenc.c b/ext/flac/gstflacenc.c
index cf5afcd..1adcdb0 100644
--- a/ext/flac/gstflacenc.c
+++ b/ext/flac/gstflacenc.c
@@ -633,7 +633,7 @@ gst_flac_enc_sink_setcaps (GstPad * pad, GstCaps * caps)

   if (total_samples != GST_CLOCK_TIME_NONE)
     FLAC__stream_encoder_set_total_samples_estimate (flacenc->encoder,
-        total_samples);
+        MIN (total_samples, G_GUINT64_CONSTANT (0x0FFFFFFFFF)));

   gst_flac_enc_set_metadata (flacenc);



-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=584455.




More information about the Gstreamer-bugs mailing list