]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugins-ugly0-10.git/commitdiff
gst-libs/gst/resample/resample.c: Fix invalid memory access (#159211).
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Wed, 5 Jan 2005 15:04:02 +0000 (15:04 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Wed, 5 Jan 2005 15:04:02 +0000 (15:04 +0000)
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).

ChangeLog
gst-libs/gst/resample/resample.c

index 622edaf58bfaefc0e59dba89a90a0d60926452dc..8ff67529a24f7217d13da724f2c910178f74448f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-05  Sebastien Cote  <sc5@hermes.usherb.ca>
+
+       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).
+
 2005-01-05  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
 
        * examples/gstplay/player.c: (main):
index cd8991596cab2aaf83a2f45327f02b13ed91e3d8..c73b1186347efd7e2c7fec2f6982ed171a1bd44c 100644 (file)
@@ -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:
     {