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;
}
return;
}
- ctx->Driver.ClearBufferSubData(ctx, offset, size,
- clearValue, clearValueSize, bufObj);
+ if (size > 0) {
+ ctx->Driver.ClearBufferSubData(ctx, offset, size,
+ clearValue, clearValueSize, bufObj);
+ }
}