Browse Source

examples/vaapi_encode: Fix leak on hwframe init failure

Fixes CID #1424882.
tags/n4.0
Mark Thompson 8 years ago
parent
commit
a763d27827
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      doc/examples/vaapi_encode.c

+ 1
- 0
doc/examples/vaapi_encode.c View File

@@ -58,6 +58,7 @@ static int set_hwframe_ctx(AVCodecContext *ctx, AVBufferRef *hw_device_ctx)
if ((err = av_hwframe_ctx_init(hw_frames_ref)) < 0) {
fprintf(stderr, "Failed to initialize VAAPI frame context."
"Error code: %s\n",av_err2str(err));
av_buffer_unref(&hw_frames_ref);
return err;
}
ctx->hw_frames_ctx = av_buffer_ref(hw_frames_ref);


Loading…
Cancel
Save