diff options
author | XANTRONIX Development | 2022-02-23 20:19:34 -0500 |
---|---|---|
committer | XANTRONIX Development | 2022-02-23 20:22:46 -0500 |
commit | 3cdeff30607fed1f5438ce5dd8ecff7d75c63dd5 (patch) | |
tree | 90970e1c50dc8dd2e87a492aedaa00d4f4231809 | |
parent | a667236c6216641f0d6158d554335097f25ee373 (diff) | |
download | xas-3cdeff30607fed1f5438ce5dd8ecff7d75c63dd5.tar.gz xas-3cdeff30607fed1f5438ce5dd8ecff7d75c63dd5.tar.bz2 xas-3cdeff30607fed1f5438ce5dd8ecff7d75c63dd5.zip |
Ensure xas_bank_record() uses same audio format
-rw-r--r-- | src/bank.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -46,6 +46,12 @@ ssize_t xas_bank_record(xas_bank *bank, size_t left = count, index_o = 0; + if (!xas_audio_format_eq(bank->format, input->format)) { + errno = EINVAL; + + goto error_invalid_format; + } + if (count > bank->entry_size) { count = bank->entry_size; } @@ -74,6 +80,7 @@ ssize_t xas_bank_record(xas_bank *bank, return entry->duration = index_o; error_audio_stream_read: +error_invalid_format: return -1; } |