From 7b9bf395433b5fa9d5a95186891a29d49e0b47c0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 2 Apr 2009 13:05:55 -0600 Subject: [PATCH] mesa: don't call ctx->Driver.ReadPixels() if width or height is zero --- src/mesa/main/readpix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index dfdd297b6e7..2326776ecbf 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -170,6 +170,9 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, return; } + if (width == 0 || height == 0) + return; /* nothing to do */ + if (ctx->Pack.BufferObj->Name) { if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1, format, type, pixels)) { -- 2.30.2