radeonsi: verify buffer_offset value before using it
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 5 Jul 2019 12:57:29 +0000 (14:57 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 15 Jul 2019 19:22:28 +0000 (15:22 -0400)
commited98f8a63a578a425a1af641baa54ea4ad855775
treea1862f2042420055b9e2632fcd85bae7efc3f42a
parenta9655f36fe9088816973c19df9399268ef6bfcd8
radeonsi: verify buffer_offset value before using it

This buffer_ofset can come directly from the application (e.g: when using
glVertexAttribPointer) and can contain an invalid value.

st_atom_array already makes sure that if it's not negative so all that's left
is to verify that it's smaller that the buffer size.

Bugs related to this issue:

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105251#c52
Bugzilla: https://bugzilla.freedesktop.org/show_bug.cgi?id=109693
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c