[FFmpeg-cvslog] vaapi_encode: Discard output buffer if picture submission fails

Mark Thompson git at videolan.org
Thu Sep 28 19:08:11 EEST 2017


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Thu Feb 16 00:02:29 2017 +0000| [17aeee5832b9188b570c3d3de4197e4cdc54c634] | committer: Mark Thompson

vaapi_encode: Discard output buffer if picture submission fails

Previously this was leaking, though it actually hit an assert making
sure that the buffer had already been cleared when freeing the picture.

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

 libavcodec/vaapi_encode.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index c02b633b46..411d879091 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -428,6 +428,8 @@ fail:
 fail_at_end:
     av_freep(&pic->codec_picture_params);
     av_frame_free(&pic->recon_image);
+    av_buffer_unref(&pic->output_buffer_ref);
+    pic->output_buffer = VA_INVALID_ID;
     return err;
 }
 



More information about the ffmpeg-cvslog mailing list