- Timestamp:
- Mar 5, 2006 1:33:57 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/resample.c
r277 r287 39 39 * - move stddefs.h and resample.h to this file. 40 40 * - const correctness. 41 * - fixed SrcLinear() may write pass output buffer. 42 * - assume the same for SrcUp() and SrcUD(), so put the same 43 * protection. 41 44 */ 42 45 #include <pjmedia/resample.h> … … 204 207 UWORD time = 0; 205 208 const HWORD *xp; 206 HWORD *Ystart ;209 HWORD *Ystart, *Yend; 207 210 WORD v,x1,x2; 208 211 … … 215 218 216 219 Ystart = Y; 220 Yend = Ystart + (unsigned)(nx * pFactor); 217 221 endTime = time + (1<<Np)*(WORD)nx; 218 while (time < endTime )222 while (time < endTime && Y < Yend) /* bennylp fix: added Y < Yend */ 219 223 { 220 224 iconst = (time) & Pmask; … … 341 345 { 342 346 const HWORD *xp; 343 HWORD *Ystart ;347 HWORD *Ystart, *Yend; 344 348 WORD v; 345 349 … … 353 357 354 358 Ystart = Y; 359 Yend = Ystart + (unsigned)(nx * pFactor); 355 360 endTime = time + (1<<Np)*(WORD)nx; 356 while (time < endTime )361 while (time < endTime && Y < Yend) /* bennylp fix: protect Y */ 357 362 { 358 363 xp = &X[time>>Np]; /* Ptr to current input sample */ … … 380 385 { 381 386 const HWORD *xp; 382 HWORD *Ystart ;387 HWORD *Ystart, *Yend; 383 388 WORD v; 384 389 … … 396 401 397 402 Ystart = Y; 403 Yend = Ystart + (unsigned)(nx * pFactor); 398 404 endTime = time + (1<<Np)*(WORD)nx; 399 while (time < endTime )405 while (time < endTime && Y < Yend) /* bennylp fix: protect Y */ 400 406 { 401 407 xp = &X[time>>Np]; /* Ptr to current input sample */
Note: See TracChangeset
for help on using the changeset viewer.