vaapi_encode: Discard output buffer if picture submission fails
[libav.git] / libavcodec / vaapi_encode.c
index c02b633..411d879 100644 (file)
@@ -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;
 }