summaryrefslogtreecommitdiff
path: root/src/codec/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/codec/common.h')
-rw-r--r--src/codec/common.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/codec/common.h b/src/codec/common.h
index 98665d7..1b468cb 100644
--- a/src/codec/common.h
+++ b/src/codec/common.h
@@ -6,7 +6,10 @@ static inline void *camu_page_alloc(size_t size)
{
#ifdef AL_HAVE_POSIX_MEMALIGN
void *ptr = NULL;
- al_posix_memalign(&ptr, al_page_size, size);
+ if (al_posix_memalign(&ptr, al_page_size, size) != 0) {
+ // For possible EINVAL rather than ENOMEM.
+ return NULL;
+ }
return ptr;
#else
return al_malloc(size);