mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-02 02:03:54 +00:00
gst/audioconvert/gstaudioconvert.c: Really don't touch read-only buffers (#156563).
Original commit message from CVS: * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_buffer_to_default_format): Really don't touch read-only buffers (#156563).
This commit is contained in:
parent
c0f76d6e35
commit
b463251864
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2004-10-29 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
|
* gst/audioconvert/gstaudioconvert.c:
|
||||||
|
(gst_audio_convert_buffer_to_default_format):
|
||||||
|
Really don't touch read-only buffers (#156563).
|
||||||
|
|
||||||
2004-10-29 Sebastien Cote <sc5@hermes.usherb.ca>
|
2004-10-29 Sebastien Cote <sc5@hermes.usherb.ca>
|
||||||
|
|
||||||
Reviewd by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
Reviewd by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
|
@ -661,6 +661,7 @@ gst_audio_convert_buffer_to_default_format (GstAudioConvert * this,
|
||||||
/* float2int */
|
/* float2int */
|
||||||
gfloat *in;
|
gfloat *in;
|
||||||
gint32 *out;
|
gint32 *out;
|
||||||
|
float temp;
|
||||||
|
|
||||||
/* should just give the same buffer, unless it's not writable -- float is
|
/* should just give the same buffer, unless it's not writable -- float is
|
||||||
* already 32 bits */
|
* already 32 bits */
|
||||||
|
@ -669,8 +670,8 @@ gst_audio_convert_buffer_to_default_format (GstAudioConvert * this,
|
||||||
in = (gfloat *) GST_BUFFER_DATA (buf);
|
in = (gfloat *) GST_BUFFER_DATA (buf);
|
||||||
out = (gint32 *) GST_BUFFER_DATA (ret);
|
out = (gint32 *) GST_BUFFER_DATA (ret);
|
||||||
for (i = buf->size / sizeof (float); i > 0; i--) {
|
for (i = buf->size / sizeof (float); i > 0; i--) {
|
||||||
*in *= 2147483647.0f + .5;
|
temp = *in * 2147483647.0f + .5;
|
||||||
*out = (gint32) CLAMP ((gint64) * in, -2147483648ll, 2147483647ll);
|
*out = (gint32) CLAMP ((gint64) temp, -2147483648ll, 2147483647ll);
|
||||||
out++;
|
out++;
|
||||||
in++;
|
in++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue