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().
parent 19d8fac3
......@@ -62,7 +62,7 @@ int default_picture_allocator(Dav1dPicture *const p, void *cookie) {
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 @@ static int picture_alloc_with_edges(Dav1dContext *const c, Dav1dPicture *const p
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment