diff --git a/ChangeLog b/ChangeLog index a848ef3262..1745591141 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-10-29 Ronald S. Bultje + + * gst/audioconvert/gstaudioconvert.c: + (gst_audio_convert_buffer_to_default_format): + Really don't touch read-only buffers (#156563). + 2004-10-29 Sebastien Cote Reviewd by: Ronald S. Bultje diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c index b2907ccea1..8e108a7d11 100644 --- a/gst/audioconvert/gstaudioconvert.c +++ b/gst/audioconvert/gstaudioconvert.c @@ -661,6 +661,7 @@ gst_audio_convert_buffer_to_default_format (GstAudioConvert * this, /* float2int */ gfloat *in; gint32 *out; + float temp; /* should just give the same buffer, unless it's not writable -- float is * already 32 bits */ @@ -669,8 +670,8 @@ gst_audio_convert_buffer_to_default_format (GstAudioConvert * this, in = (gfloat *) GST_BUFFER_DATA (buf); out = (gint32 *) GST_BUFFER_DATA (ret); for (i = buf->size / sizeof (float); i > 0; i--) { - *in *= 2147483647.0f + .5; - *out = (gint32) CLAMP ((gint64) * in, -2147483648ll, 2147483647ll); + temp = *in * 2147483647.0f + .5; + *out = (gint32) CLAMP ((gint64) temp, -2147483648ll, 2147483647ll); out++; in++; }