mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/libdav1d: reset pool size on allocation failure
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
f8075b2c91
commit
5cd60b6f2e
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue