Unified · Split
| @@ -1,3 +1,9 @@ | ||
| 1 | +2008-07-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com> | |
| 2 | + | |
| 3 | + * src/samplerate.c | |
| 4 | + Fix a valgrind warning which occured when the call back function returns | |
| 5 | + a count of zero without modifying the pointer value. Thanks to Paul Kelly. | |
| 6 | + | |
| 1 | 7 | 2008-07-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com> |
| 2 | 8 | |
| 3 | 9 | * src/src_sinc.c |
| @@ -132,16 +132,13 @@ src_process (SRC_STATE *state, SRC_DATA *data) · 131 unmodified lines | ||
| 132 | 132 | if (data == NULL) |
| 133 | 133 | return SRC_ERR_BAD_DATA ; |
| 134 | 134 | |
| 135 | − /* Check src_ratio is in range. */ | |
| 136 | − if (is_bad_src_ratio (data->src_ratio)) | |
| 137 | − return SRC_ERR_BAD_SRC_RATIO ; | |
| 138 | − | |
| 139 | 135 | /* And that data_in and data_out are valid. */ |
| 140 | 136 | if (data->data_in == NULL || data->data_out == NULL) |
| 141 | 137 | return SRC_ERR_BAD_DATA_PTR ; |
| 142 | 138 | |
| 143 | − if (data->data_in == NULL) | |
| 144 | − data->input_frames = 0 ; | |
| 139 | + /* Check src_ratio is in range. */ | |
| 140 | + if (is_bad_src_ratio (data->src_ratio)) | |
| 141 | + return SRC_ERR_BAD_SRC_RATIO ; | |
| 145 | 142 | |
| 146 | 143 | if (data->input_frames < 0) |
| 147 | 144 | data->input_frames = 0 ; |
| @@ -226,7 +223,11 @@ src_callback_read (SRC_STATE *state, double src_ratio, long frames, float *data) · 78 unmodified lines | ||
| 226 | 223 | while (output_frames_gen < frames) |
| 227 | 224 | { |
| 228 | 225 | if (src_data.input_frames == 0) |
| 229 | − { float *ptr ; | |
| 226 | + { /* Use a dummy array for the case where the callback function | |
| 227 | + ** returns without setting the ptr. | |
| 228 | + */ | |
| 229 | + float dummy [1] ; | |
| 230 | + float *ptr = dummy ; | |
| 230 | 231 | |
| 231 | 232 | src_data.input_frames = psrc->callback_func (psrc->user_callback_data, &ptr) ; |
| 232 | 233 | src_data.data_in = ptr ; |