flacenc: never ever pass values >36bits to _set_total_samples_estimate()

Let's be paranoid and make sure we never pass a number that takes up
more than 36 bits to _set_total_samples_estimate(), since libFLAC
expects all the other bits to be zero, and if this is not the case
neighbouring fields in the global stream info header may get messed
up inadvertently, so that flac -d refuses to decode the stream.
See #584455.
This commit is contained in:
Tim-Philipp Müller 2009-06-02 00:37:15 +01:00
parent 0de1f5357d
commit 53be1d33ca

View file

@ -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);