Otherwise it will result in invalid reading in va_TraceEnd()
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit
d4988142a3f2256e38c5c5cdcdfc1b4f5f3c1ea9)
Tested-by: Daniel Charles <daniel.charles@intel.com> on ChromiumOS
free(old_ctx->vtable_vpp);
old_ctx->vtable_vpp = NULL;
- if (VA_STATUS_SUCCESS == vaStatus)
- pDisplayContext->vaDestroy(pDisplayContext);
-
VA_TRACE_LOG(va_TraceTerminate, dpy);
va_TraceEnd(dpy);
va_FoolEnd(dpy);
+ if (VA_STATUS_SUCCESS == vaStatus)
+ pDisplayContext->vaDestroy(pDisplayContext);
+
return vaStatus;
}