mesa: return NULL if we exceed MaxColorAttachments in get_fb_attachment
authorTapani Pälli <tapani.palli@intel.com>
Thu, 14 Feb 2019 07:02:31 +0000 (09:02 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 18 Feb 2019 05:51:55 +0000 (07:51 +0200)
commit9762a9f89380a8070654a80e73d927297c29da35
tree3de9b39ba9e8b92d98442ff84aaf58bdacb2ea09
parent2c6a7fbeb78856d6405e1c0dff17a58478b0019e
mesa: return NULL if we exceed MaxColorAttachments in get_fb_attachment

This fixes invalid access to Attachment array which would occur if caller
would exceed MaxColorAttachments. In practice this should not ever happen
because DiscardFramebufferEXT specifies only GL_COLOR_ATTACHMENT0 to be
valid and InvalidateFramebuffer will error out before but this should
make coverity happy.

v2: const, remove _EXT (Ian)

CID: 1442559
Fixes: 0c42b5f3cb9 "mesa: wire up InvalidateFramebuffer"
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/fbobject.c