summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_encode.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2017-02-16 00:02:29 +0000
committerMark Thompson <sw@jkqxz.net>2017-02-16 20:58:42 +0000
commit17aeee5832b9188b570c3d3de4197e4cdc54c634 (patch)
tree1cd1258805daec325c1c39d3703dca7c64883c57 /libavcodec/vaapi_encode.c
parent8f5de34c8fb18fa1416e77d2cb998773a49ddb3d (diff)
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.
Diffstat (limited to 'libavcodec/vaapi_encode.c')
-rw-r--r--libavcodec/vaapi_encode.c2
1 files changed, 2 insertions, 0 deletions
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;
}