Summary: | out-of-bounds access src/mesa/main/fbobject:222 | ||
---|---|---|---|
Product: | Mesa | Reporter: | Vinson Lee <vlee> |
Component: | Other | Assignee: | Vinson Lee <vlee> |
Status: | RESOLVED MOVED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | brianp |
Version: | git | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Vinson Lee
2012-08-13 01:01:16 UTC
This warning is kind of bogus. Jose suggested adding an assertion like this: assert(BUFFER_COLOR0 + ctx->Const.MaxColorAttachments <= Elements(fb->Attachment)); Alternately, can you try this patch, Vinson? diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 792a92d..03094cc 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -215,8 +215,9 @@ _mesa_get_attachment(struct gl_context *ctx, struct gl_frame * hardware is used. */ i = attachment - GL_COLOR_ATTACHMENT0_EXT; - if (i >= ctx->Const.MaxColorAttachments - || (i > 0 && ctx->API == API_OPENGLES)) { + if (i >= ctx->Const.MaxColorAttachments || + BUFFER_COLOR0 + i >= Elements(fb->Attachment) || + (i > 0 && ctx->API == API_OPENGLES)) { return NULL; } return &fb->Attachment[BUFFER_COLOR0 + i]; -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/899. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.