diff options
author | Brian Paul <[email protected]> | 2014-03-03 09:59:45 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2014-03-03 10:41:42 -0700 |
commit | aff7c5e78ab133866a90f67613508735c9b75094 (patch) | |
tree | ce77a53bdd6af831dd79f78088fd8a3f920f4d73 /src | |
parent | 465b2c42bca59f0f198aeb8543cfabd5989584b4 (diff) |
mesa: don't call ctx->Driver.ClearBufferSubData() if size==0
Fixes failed assertion when trying to map zero-length region.
https://bugs.freedesktop.org/show_bug.cgi?id=75660
Cc: "10.0" "10.1" <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/bufferobj.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 237b49cb1c7..9ef55a784a1 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1508,8 +1508,10 @@ _mesa_ClearBufferSubData(GLenum target, GLenum internalformat, if (data == NULL) { /* clear to zeros, per the spec */ - ctx->Driver.ClearBufferSubData(ctx, offset, size, - NULL, 0, bufObj); + if (size > 0) { + ctx->Driver.ClearBufferSubData(ctx, offset, size, + NULL, 0, bufObj); + } return; } @@ -1519,8 +1521,10 @@ _mesa_ClearBufferSubData(GLenum target, GLenum internalformat, return; } - ctx->Driver.ClearBufferSubData(ctx, offset, size, - clearValue, clearValueSize, bufObj); + if (size > 0) { + ctx->Driver.ClearBufferSubData(ctx, offset, size, + clearValue, clearValueSize, bufObj); + } } |