summaryrefslogtreecommitdiffstats
path: root/ext/flac
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2009-06-02 00:37:15 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-06-02 00:46:42 +0100
commit53be1d33caa5278b61101f06db6c23c982219a1e (patch)
treecf2de516adb57a814c503dc7aa01d6ab11778db4 /ext/flac
parent0de1f5357d2522323071d698ff7c588d16ced601 (diff)
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.
Diffstat (limited to 'ext/flac')
-rw-r--r--ext/flac/gstflacenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/flac/gstflacenc.c b/ext/flac/gstflacenc.c
index cf5afcd3..6eab536d 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);