Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/view.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 62f087b23a..f75dd00000 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -128,6 +128,13 @@ static const struct wined3d_format *validate_resource_view(const struct wined3d_ struct wined3d_texture *texture = texture_from_resource(resource); unsigned int depth_or_layer_count;
+ if (resource->format->id != format->id && !wined3d_format_is_typeless(resource->format)) + { + WARN("Trying to create incompatible view for non typeless format %s.\n", + debug_d3dformat(format->id)); + return NULL; + } + if (mip_slice && resource->type == WINED3D_RTYPE_TEXTURE_3D) depth_or_layer_count = wined3d_texture_get_level_depth(texture, desc->u.texture.level_idx); else