Fixes allocation failure in an edge case where the current code can
run out of reconstructed surfaces to use when truncating the end of a
stream containing B frames.
---
 libavcodec/vaapi_encode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 11e46ea..bd8cdb5 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1250,7 +1250,7 @@ static av_cold int 
vaapi_encode_create_recon_frames(AVCodecContext *avctx)
     ctx->recon_frames->width     = ctx->surface_width;
     ctx->recon_frames->height    = ctx->surface_height;
     ctx->recon_frames->initial_pool_size =
-        avctx->max_b_frames + 3;
+        avctx->max_b_frames + 4;
 
     err = av_hwframe_ctx_init(ctx->recon_frames_ref);
     if (err < 0) {
-- 
2.10.2

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to