summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-23 11:19:09 +0100
committerwm4 <wm4@nowhere>2013-12-23 11:22:12 +0100
commit6565ec8b41df839dfb5b6c5ff724e0626cf484d0 (patch)
treedceb5669a5bde55dbafb2c27b0d8e0e6856a9a4e /video
parent7ef8d38769ece1bae4f539d5492b501c2825e363 (diff)
downloadmpv-6565ec8b41df839dfb5b6c5ff724e0626cf484d0.tar.bz2
mpv-6565ec8b41df839dfb5b6c5ff724e0626cf484d0.tar.xz
vaapi: fix initialization error code path
"res" can be uninitialized in the error case.
Diffstat (limited to 'video')
-rw-r--r--video/vaapi.c3
1 files changed, 2 insertions, 1 deletions
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,