wined3d: Avoid NULL pointer dereference when using GDI renderer.

Fixes a regression introduced in 62ca4f3826.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2017-06-16 16:01:04 +02:00 committed by Alexandre Julliard
parent 4fc5d8873c
commit a2c0d2bb37
1 changed files with 4 additions and 2 deletions

View File

@ -2703,12 +2703,13 @@ void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint
void *context_map_bo_address(struct wined3d_context *context,
const struct wined3d_bo_address *data, size_t size, GLenum binding, DWORD flags)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
const struct wined3d_gl_info *gl_info;
BYTE *memory;
if (!data->buffer_object)
return data->addr;
gl_info = context->gl_info;
context_bind_bo(context, binding, data->buffer_object);
if (gl_info->supported[ARB_MAP_BUFFER_RANGE])
@ -2731,11 +2732,12 @@ void *context_map_bo_address(struct wined3d_context *context,
void context_unmap_bo_address(struct wined3d_context *context,
const struct wined3d_bo_address *data, GLenum binding)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
const struct wined3d_gl_info *gl_info;
if (!data->buffer_object)
return;
gl_info = context->gl_info;
context_bind_bo(context, binding, data->buffer_object);
GL_EXTCALL(glUnmapBuffer(binding));
context_bind_bo(context, binding, 0);