Commit 5cd60b6f authored by James Almer's avatar James Almer

avcodec/libdav1d: reset pool size on allocation failure

Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent f8075b2c
......@@ -72,8 +72,10 @@ static int libdav1d_picture_allocator(Dav1dPicture *p, void *cookie)
av_buffer_pool_uninit(&dav1d->pool);
// Use twice the amount of required padding bytes for aligned_ptr below.
dav1d->pool = av_buffer_pool_init(ret + DAV1D_PICTURE_ALIGNMENT * 2, NULL);
if (!dav1d->pool)
if (!dav1d->pool) {
dav1d->pool_size = 0;
return AVERROR(ENOMEM);
}
dav1d->pool_size = ret;
}
buf = av_buffer_pool_get(dav1d->pool);
......
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