summaryrefslogtreecommitdiffstats
path: root/gst-libs/gst/resample
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-01-05 15:04:02 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-01-05 15:04:02 +0000
commit02add212a0f0e83dbc3ce667864f249a15852b04 (patch)
treee354d42305f2828566c7542004e940fd1f7616a7 /gst-libs/gst/resample
parent287845087692f134141d2a12ab5681668c2620db (diff)
downloadgst-plugins-bad-02add212a0f0e83dbc3ce667864f249a15852b04.tar.gz
gst-plugins-bad-02add212a0f0e83dbc3ce667864f249a15852b04.tar.bz2
gst-plugins-bad-02add212a0f0e83dbc3ce667864f249a15852b04.zip
gst-libs/gst/resample/resample.c: Fix invalid memory access (#159211).
Original commit message from CVS: Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net> * gst-libs/gst/resample/resample.c: (gst_resample_sinc_ft_s16): Fix invalid memory access (#159211).
Diffstat (limited to 'gst-libs/gst/resample')
-rw-r--r--gst-libs/gst/resample/resample.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gst-libs/gst/resample/resample.c b/gst-libs/gst/resample/resample.c
index cd899159..c73b1186 100644
--- a/gst-libs/gst/resample/resample.c
+++ b/gst-libs/gst/resample/resample.c
@@ -268,7 +268,8 @@ gst_resample_nearest_s16 (gst_resample_t * r)
SCALE_LOOP (o_ptr[0] = i_ptr[0], 1);
break;
case 2:
- SCALE_LOOP (o_ptr[0] = i_ptr[0]; o_ptr[1] = i_ptr[1], 2);
+ SCALE_LOOP (o_ptr[0] = i_ptr[0];
+ o_ptr[1] = i_ptr[1], 2);
break;
default:
{
@@ -545,6 +546,8 @@ gst_resample_sinc_ft_s16 (gst_resample_t * r)
o_ptr = (signed short *) r->o_buf;
center = r->o_start;
+ while (center - r->halftaps < -1 * r->filter_length)
+ center += 1.0;
start_x = center - r->halftaps;
start_f = floor (start_x);
start_x -= start_f;
@@ -627,7 +630,8 @@ gst_resample_nearest_float (gst_resample_t * r)
SCALE_LOOP (o_ptr[0] = i_ptr[0], 1);
break;
case 2:
- SCALE_LOOP (o_ptr[0] = i_ptr[0]; o_ptr[1] = i_ptr[1], 2);
+ SCALE_LOOP (o_ptr[0] = i_ptr[0];
+ o_ptr[1] = i_ptr[1], 2);
break;
default:
{