History

src/src_linear.c : Fix a bug where the the converter was reading beyond the end of the input. Thanks to Paul Kelly for the bug report.

Erik de Castro Lopo committed 18 years ago

Commit 2df44c21 parent f2b2cbc2 files · +10 −2Browse files

Unified · Split

2 files
  1. ChangeLog +8 −0
  2. src/src_linear.c +2 −2
ChangeLog+8−0
@@ -6,6 +6,14 @@ · 5 unmodified lines
6 * tests/callback_test.c6 * tests/callback_test.c
7 Test with 2 channels for improved generality. Simplify setup.7 Test with 2 channels for improved generality. Simplify setup.
8 8
9 * src/src_linear.c src/src_zoh.c
10 Change local variable names to be the same across these two files for easier
11 comparison.
12
13 * src/src_linear.c
14 Fix a bug where the the converter was reading beyond the end of the input.
15 Thanks to Paul Kelly for the bug report.
16
92008-07-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>172008-07-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
10 18
11 * tests/downsample_test.c19 * tests/downsample_test.c
src/src_linear.c+2−2
@@ -80,7 +80,7 @@ linear_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data) · 79 unmodified lines
80 /* Calculate samples before first sample in input array. */80 /* Calculate samples before first sample in input array. */
81 while (input_index < 1.0 && priv->out_gen < priv->out_count)81 while (input_index < 1.0 && priv->out_gen < priv->out_count)
82 {82 {
83 if (priv->in_used + priv->channels * input_index > priv->in_count)83 if (priv->in_used + priv->channels * (1.0 + input_index) >= priv->in_count)
84 break ;84 break ;
85 85
86 if (priv->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF)86 if (priv->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF)
@@ -101,7 +101,7 @@ linear_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data) · 14 unmodified lines
101 input_index = rem ;101 input_index = rem ;
102 102
103 /* Main processing loop. */103 /* Main processing loop. */
104 while (priv->out_gen < priv->out_count && priv->in_used + priv->channels * input_index <= priv->in_count)104 while (priv->out_gen < priv->out_count && priv->in_used + priv->channels * input_index < priv->in_count)
105 {105 {
106 if (priv->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF)106 if (priv->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF)
107 src_ratio = psrc->last_ratio + priv->out_gen * (data->src_ratio - psrc->last_ratio) / priv->out_count ;107 src_ratio = psrc->last_ratio + priv->out_gen * (data->src_ratio - psrc->last_ratio) / priv->out_count ;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t