From 53be1d33caa5278b61101f06db6c23c982219a1e Mon Sep 17 00:00:00 2001 From: Tim-Philipp Müller Date: Tue, 2 Jun 2009 00:37:15 +0100 Subject: 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. --- ext/flac/gstflacenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/flac') 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); -- cgit