mesa/samplerobj: Avoid crash in sampler query if texture unit is disabled
authorPauli Nieminen <pauli.nieminen@linux.intel.com>
Tue, 12 Jun 2012 18:38:48 +0000 (21:38 +0300)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 12 Aug 2012 23:18:41 +0000 (16:18 -0700)
commitac4dc5e9312f3ef154135a68521e7a20c88b7837
tree95936af071cf6883dde9c4911cdde974e1fa9dd3
parent5606bd574e264c4beda8eb1d10b48d17e9b8b497
mesa/samplerobj: Avoid crash in sampler query if texture unit is disabled

Sampler queries are so far made only for enabled texture unit. But if
any code would query sampler before checking texture unit state that
would result to NULL deference.

Making the inline helper easier to use with NULL check makes a lot sense
because compiler is likely to combine the checks for the current texture.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/samplerobj.h