[FFmpeg-cvslog] avcodec/libdav1d: reset pool size on allocation failure

James Almer git at videolan.org
Tue Mar 19 19:11:42 EET 2019


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Mar 15 23:55:45 2019 -0300| [5cd60b6f2ed8a30341e8f98a38858c18505f6f75] | committer: James Almer

avcodec/libdav1d: reset pool size on allocation failure

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5cd60b6f2ed8a30341e8f98a38858c18505f6f75
---

 libavcodec/libdav1d.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);



More information about the ffmpeg-cvslog mailing list