From: Benjamin Otte Date: Sun, 28 Nov 2004 20:41:23 +0000 (+0000) Subject: gst/audioconvert/gstchannelmix.c: more overwriting protection due to modifying channe... X-Git-Tag: 1.19.3~511^2~13437 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05103c18ca9de552b0e45e62d24cd14cadcab5e7;p=platform%2Fupstream%2Fgstreamer.git gst/audioconvert/gstchannelmix.c: more overwriting protection due to modifying channels one by one instead of all at ... Original commit message from CVS: * gst/audioconvert/gstchannelmix.c: (gst_audio_convert_mix): more overwriting protection due to modifying channels one by one instead of all at once --- diff --git a/ChangeLog b/ChangeLog index 070ab4a..fd51dec8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-11-28 Benjamin Otte + + * gst/audioconvert/gstchannelmix.c: (gst_audio_convert_mix): + more overwriting protection due to modifying channels one by one + instead of all at once + 2004-11-28 Ronald S. Bultje * gst/audioconvert/gstchannelmix.c: diff --git a/gst/audioconvert/gstchannelmix.c b/gst/audioconvert/gstchannelmix.c index f78acf2..774ffff 100644 --- a/gst/audioconvert/gstchannelmix.c +++ b/gst/audioconvert/gstchannelmix.c @@ -24,6 +24,7 @@ #endif #include +#include #include #include "gstchannelmix.h" @@ -532,6 +533,7 @@ gst_audio_convert_mix (GstAudioConvert * this, { gint in, out, n; gint64 res; + gint32 tmp[this->srccaps.channels]; gboolean backwards = this->srccaps.channels > this->sinkcaps.channels; /* FIXME: use liboil here? */ @@ -550,9 +552,9 @@ gst_audio_convert_mix (GstAudioConvert * this, res = G_MININT32; else if (res > G_MAXINT32) res = G_MAXINT32; - - /* store */ - out_data[n * this->srccaps.channels + out] = res; + tmp[out] = res; } + memcpy (&out_data[n * this->srccaps.channels], tmp, + sizeof (gint32) * this->srccaps.channels); } }