[Mesa-dev] [PATCH] swrast: Initialize drawFormat in blit_linear after drawRb is initialized
Brian Paul
brian.e.paul at gmail.com
Thu Jan 17 08:11:04 PST 2013
I just posted a patch that fixes this and several other issues in that
code. I didn't see your patch until just now. I think we should go
with mine.
-Brian
On Thu, Jan 17, 2013 at 7:43 AM, Anuj Phogat <anuj.phogat at gmail.com> wrote:
> This fixes a segfault in blit_linear() function:
> https://bugs.freedesktop.org/show_bug.cgi?id=59499
>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
> src/mesa/swrast/s_blit.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c
> index 043b578..b643abf 100644
> --- a/src/mesa/swrast/s_blit.c
> +++ b/src/mesa/swrast/s_blit.c
> @@ -542,8 +542,8 @@ blit_linear(struct gl_context *ctx,
> GLint srcBufferY0 = -1, srcBufferY1 = -1;
> GLvoid *dstBuffer;
>
> + gl_format drawFormat;
> gl_format readFormat = _mesa_get_srgb_format_linear(readRb->Format);
> - gl_format drawFormat = _mesa_get_srgb_format_linear(drawRb->Format);
> GLuint bpp = _mesa_get_format_bytes(readFormat);
>
> GLenum pixelType;
> @@ -592,6 +592,7 @@ blit_linear(struct gl_context *ctx,
> continue;
> drawAtt = &drawFb->Attachment[idx];
> drawRb = drawAtt->Renderbuffer;
> + drawFormat = _mesa_get_srgb_format_linear(drawRb->Format);
> /*
> * Map src / dst renderbuffers
> */
> --
> 1.7.7.6
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list