mesa: Prevent _MaxLevel from being less than zero
authorThong Thai <thong.thai@amd.com>
Tue, 7 Jan 2020 21:38:25 +0000 (16:38 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 8 Jan 2020 21:44:20 +0000 (16:44 -0500)
commit3a4f8c8158df304af08681edbbfdfd40e43a6829
treec8779652e7a27d85a8ed28bfb6492dc310e49af0
parent9b710416270b05ddc08e26e38fd87ff589b2860d
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>
src/mesa/main/texobj.c