mirror of https://git.ffmpeg.org/ffmpeg.git
examples/vaapi_encode: Fix leak on hwframe init failure
Fixes CID #1424882.
This commit is contained in:
parent
6939b3cb9d
commit
a763d27827
|
@ -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…
Reference in New Issue