ref: d7c3420b69d225fb2aff1165138690fbd17a67d8
parent: 19d8fac33ede74d31aa02c9b0b987aadeba53cf6
author: James Almer <[email protected]>
date: Fri Mar 1 10:43:40 EST 2019
picture: fix default_picture_allocator() return value on failure The doxy for Dav1dPicAllocator.alloc_picture_callback() states it must be a negative errno value. Propagate it as well in picture_alloc_with_edges().
--- a/src/picture.c
+++ b/src/picture.c
@@ -62,7 +62,7 @@
uint8_t *data = dav1d_alloc_aligned(pic_size + DAV1D_PICTURE_ALIGNMENT,
DAV1D_PICTURE_ALIGNMENT);
if (data == NULL) {
- return -1;
+ return -ENOMEM;
}
p->data[0] = data;
@@ -131,7 +131,7 @@
int res = p_allocator->alloc_picture_callback(p, p_allocator->cookie);
if (res < 0) {
free(pic_ctx);
- return -ENOMEM;
+ return res;
}
pic_ctx->allocator = *p_allocator;