]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libdav1d.c
avcodec/libdav1d: reset pool size on allocation failure
[ffmpeg] / libavcodec / libdav1d.c
index 8c8584f4e804ef54978d39ec61d7cca9ea5eb9fd..d9079cbbeff581663341df5134d39c1e04d36427 100644 (file)
@@ -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);