ref: 5e56ae8b017a1475f736a6fa111ea4b960e76aab
parent: 02ebb9f0fc4d67cb3f1ac4c2283664340510fd68
author: Robert Kausch <robert.kausch@freac.org>
date: Sun Jan 14 07:47:04 EST 2018
Accept NULL data_in pointer when passing zero input frames Closes: https://github.com/erikd/libsamplerate/pull/33 Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
--- a/src/samplerate.c
+++ b/src/samplerate.c
@@ -141,7 +141,7 @@
return SRC_ERR_BAD_DATA ;
/* And that data_in and data_out are valid. */
- if (data->data_in == NULL || data->data_out == NULL)
+ if ((data->data_in == NULL && data->input_frames > 0) || data->data_out == NULL)
return SRC_ERR_BAD_DATA_PTR ;
/* Check src_ratio is in range. */