diff options
author | James Almer <jamrial@gmail.com> | 2019-03-15 23:55:45 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-03-19 14:03:39 -0300 |
commit | 5cd60b6f2ed8a30341e8f98a38858c18505f6f75 (patch) | |
tree | c8d28fe4e654b9fdaf3287ffa57b07404fc6a8f5 /libavcodec/libdav1d.c | |
parent | f8075b2c91c39097322c44e24847c5a20e73a943 (diff) | |
download | ffmpeg-5cd60b6f2ed8a30341e8f98a38858c18505f6f75.tar.gz |
avcodec/libdav1d: reset pool size on allocation failure
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/libdav1d.c')
-rw-r--r-- | libavcodec/libdav1d.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 8c8584f4e8..d9079cbbef 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -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); |