mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
gallivm: fix crash in lp_sampler_static_state()
Fixes WebGL conformance/uniforms/uniform-default-values.html crash. We need to check for the null view pointer before accessing view->texture. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53317 Note: This is a candidate for the 8.0 branch. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
This commit is contained in:
parent
9b04abe368
commit
f7af4beae5
1 changed files with 3 additions and 4 deletions
|
|
@ -96,15 +96,14 @@ lp_sampler_static_state(struct lp_sampler_static_state *state,
|
|||
const struct pipe_sampler_view *view,
|
||||
const struct pipe_sampler_state *sampler)
|
||||
{
|
||||
const struct pipe_resource *texture = view->texture;
|
||||
const struct pipe_resource *texture;
|
||||
|
||||
memset(state, 0, sizeof *state);
|
||||
|
||||
if(!texture)
|
||||
if (!sampler || !view || !view->texture)
|
||||
return;
|
||||
|
||||
if(!sampler)
|
||||
return;
|
||||
texture = view->texture;
|
||||
|
||||
/*
|
||||
* We don't copy sampler state over unless it is actually enabled, to avoid
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue