[FFmpeg-devel] [PATCH] avutil/hwcontext_vaapi: fix SEGV in vaTerminate when vaInitialize fails
wm4
nfxjfg at googlemail.com
Fri Feb 3 07:45:56 EET 2017
On Thu, 2 Feb 2017 09:29:13 -0800
Aman Gupta <ffmpeg at tmm1.net> wrote:
> From: Aman Gupta <aman at tmm1.net>
>
> Program terminated with signal SIGSEGV, Segmentation fault.
> opts=opts at entry=0x0, flags=flags at entry=0) at libavutil/hwcontext.c:494
> ---
> libavutil/hwcontext_vaapi.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
> index 6176bdc..0051acb 100644
> --- a/libavutil/hwcontext_vaapi.c
> +++ b/libavutil/hwcontext_vaapi.c
> @@ -961,14 +961,13 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,
> return AVERROR(EINVAL);
> }
>
> - hwctx->display = display;
> -
> vas = vaInitialize(display, &major, &minor);
> if (vas != VA_STATUS_SUCCESS) {
> av_log(ctx, AV_LOG_ERROR, "Failed to initialise VAAPI "
> "connection: %d (%s).\n", vas, vaErrorStr(vas));
> return AVERROR(EIO);
> }
> + hwctx->display = display;
> av_log(ctx, AV_LOG_VERBOSE, "Initialised VAAPI connection: "
> "version %d.%d\n", major, minor);
>
Would that mean it doesn't free the display that was created with
vaGetDisplay? Is that right?
In my experiments, calling vaTerminate right after vaGetDisplay works
just fine.
More information about the ffmpeg-devel
mailing list