From 6565ec8b41df839dfb5b6c5ff724e0626cf484d0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 23 Dec 2013 11:19:09 +0100 Subject: vaapi: fix initialization error code path "res" can be uninitialized in the error case. --- video/vaapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'video') diff --git a/video/vaapi.c b/video/vaapi.c index 286e621ec1..0bdffe3c72 100644 --- a/video/vaapi.c +++ b/video/vaapi.c @@ -108,6 +108,7 @@ static void va_get_formats(struct mp_vaapi_ctx *ctx) struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog) { + struct mp_vaapi_ctx *res = NULL; struct mp_log *log = mp_log_new(NULL, plog, "/vaapi"); int major_version, minor_version; int status = vaInitialize(display, &major_version, &minor_version); @@ -116,7 +117,7 @@ struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog) mp_verbose(log, "VA API version %d.%d\n", major_version, minor_version); - struct mp_vaapi_ctx *res = talloc_ptrtype(NULL, res); + res = talloc_ptrtype(NULL, res); *res = (struct mp_vaapi_ctx) { .log = talloc_steal(res, log), .display = display, -- cgit v1.2.3