summaryrefslogtreecommitdiff
path: root/source/kit/input_buffer.c
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2024-02-29 00:51:42 +0100
committerMitya Selivanov <automainint@guattari.tech>2024-02-29 00:51:42 +0100
commit2dab66694bb72ee222a44c49c669e9f5adc024f0 (patch)
tree53e89f2cdab40292801da8fe8fb0a511d39377bb /source/kit/input_buffer.c
parent0948d02a5a3abae918fa8f5fe1587e19cd0ada41 (diff)
downloadsaw-2dab66694bb72ee222a44c49c669e9f5adc024f0.zip
Load audio file with miniaudio instead of dr_libs; Fix null dereference when loading empty sampler
Diffstat (limited to 'source/kit/input_buffer.c')
-rw-r--r--source/kit/input_buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/kit/input_buffer.c b/source/kit/input_buffer.c
index db7e156..59298c8 100644
--- a/source/kit/input_buffer.c
+++ b/source/kit/input_buffer.c
@@ -19,7 +19,7 @@ static s32 kit_buf_adjust_(kit_input_buffer_t *buf, i64 size) {
DA_RESIZE(buf->data, size);
if (buf->data.size != size)
- return KIT_ERROR_BAD_ALLOC;
+ return KIT_ERROR_OUT_OF_MEMORY;
str_t destination = { .size = size - offset,
.values = buf->data.values + offset };
@@ -27,7 +27,7 @@ static s32 kit_buf_adjust_(kit_input_buffer_t *buf, i64 size) {
DA_RESIZE(buf->data, offset + n);
if (buf->data.size != offset + n)
- return KIT_ERROR_BAD_ALLOC;
+ return KIT_ERROR_OUT_OF_MEMORY;
return KIT_OK;
}
@@ -118,7 +118,7 @@ kit_ib_token_t kit_ib_read(kit_ib_token_t tok, i64 size) {
} else { \
DA_INIT(cache_dynamic, data.size, tok.buffer->data.alloc); \
if (cache_dynamic.size != data.size) { \
- (res_).status |= KIT_ERROR_BAD_ALLOC; \
+ (res_).status |= KIT_ERROR_OUT_OF_MEMORY; \
return (res_); \
} \
memcpy(cache_dynamic.values, data.values, data.size); \