mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 07:50:11 +01:00
mesa: Prevent _MaxLevel from being less than zero
When decoding using VDPAU, the _MaxLevel value becomes -1 due to NumLevels being equal to 0 at a certain point, and decoding fails due to an assertion later on. Signed-off-by: Thong Thai <thong.thai@amd.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com> Cc: 19.2 19.3 <mesa-stable@lists.freedesktop.org>
This commit is contained in:
parent
9b71041627
commit
3a4f8c8158
1 changed files with 1 additions and 1 deletions
|
|
@ -757,7 +757,7 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
|
|||
/* Adjust max level for views: the data store may have more levels than
|
||||
* the view exposes.
|
||||
*/
|
||||
t->_MaxLevel = MIN2(t->_MaxLevel, t->NumLevels - 1);
|
||||
t->_MaxLevel = MAX2(MIN2(t->_MaxLevel, t->NumLevels - 1), 0);
|
||||
}
|
||||
|
||||
/* Compute _MaxLambda = q - p in the spec used during mipmapping */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue