idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
7,000 | static NOINLINE int send_select(uint32_t xid, uint32_t server, uint32_t requested)
{
struct dhcp_packet packet;
struct in_addr temp_addr;
/*
* RFC 2131 4.3.2 DHCPREQUEST message
* ...
* If the DHCPREQUEST message contains a 'server identifier'
* option, the message is in response to a DHCPOFFER message.
* Other... | +Info | 0 | static NOINLINE int send_select(uint32_t xid, uint32_t server, uint32_t requested)
{
struct dhcp_packet packet;
struct in_addr temp_addr;
/*
* RFC 2131 4.3.2 DHCPREQUEST message
* ...
* If the DHCPREQUEST message contains a 'server identifier'
* option, the message is in response to a DHCPOFFER message.
* Other... | @@ -531,7 +531,7 @@ static char **fill_envp(struct dhcp_packet *packet)
temp = udhcp_get_option(packet, code);
*curr = xmalloc_optname_optval(temp, &dhcp_optflags[i], opt_name);
putenv(*curr++);
- if (code == DHCP_SUBNET) {
+ if (code == DHCP_SUBNET && temp[-OPT_DATA + OPT_LEN] == 4) {
/* Subnet option: ... | CWE-125 | null | null |
7,001 | static int sprint_nip(char *dest, const char *pre, const uint8_t *ip)
{
return sprintf(dest, "%s%u.%u.%u.%u", pre, ip[0], ip[1], ip[2], ip[3]);
}
| +Info | 0 | static int sprint_nip(char *dest, const char *pre, const uint8_t *ip)
{
return sprintf(dest, "%s%u.%u.%u.%u", pre, ip[0], ip[1], ip[2], ip[3]);
}
| @@ -531,7 +531,7 @@ static char **fill_envp(struct dhcp_packet *packet)
temp = udhcp_get_option(packet, code);
*curr = xmalloc_optname_optval(temp, &dhcp_optflags[i], opt_name);
putenv(*curr++);
- if (code == DHCP_SUBNET) {
+ if (code == DHCP_SUBNET && temp[-OPT_DATA + OPT_LEN] == 4) {
/* Subnet option: ... | CWE-125 | null | null |
7,002 | static int udhcp_raw_socket(int ifindex)
{
int fd;
struct sockaddr_ll sock;
log2("opening raw socket on ifindex %d", ifindex);
fd = xsocket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP));
/* ^^^^^
* SOCK_DGRAM: remove link-layer headers on input (SOCK_RAW keeps them)
* ETH_P_IP: want to receive only packets with IP... | +Info | 0 | static int udhcp_raw_socket(int ifindex)
{
int fd;
struct sockaddr_ll sock;
log2("opening raw socket on ifindex %d", ifindex);
fd = xsocket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP));
/* ^^^^^
* SOCK_DGRAM: remove link-layer headers on input (SOCK_RAW keeps them)
* ETH_P_IP: want to receive only packets with IP... | @@ -531,7 +531,7 @@ static char **fill_envp(struct dhcp_packet *packet)
temp = udhcp_get_option(packet, code);
*curr = xmalloc_optname_optval(temp, &dhcp_optflags[i], opt_name);
putenv(*curr++);
- if (code == DHCP_SUBNET) {
+ if (code == DHCP_SUBNET && temp[-OPT_DATA + OPT_LEN] == 4) {
/* Subnet option: ... | CWE-125 | null | null |
7,003 | static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
{
int bytes;
struct ip_udp_dhcp_packet packet;
uint16_t check;
unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))];
struct iovec iov;
struct msghdr msg;
struct cmsghdr *cmsg;
/* used to use just safe_read(fd, &packet, s... | +Info | 0 | static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
{
int bytes;
struct ip_udp_dhcp_packet packet;
uint16_t check;
unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))];
struct iovec iov;
struct msghdr msg;
struct cmsghdr *cmsg;
/* used to use just safe_read(fd, &packet, s... | @@ -531,7 +531,7 @@ static char **fill_envp(struct dhcp_packet *packet)
temp = udhcp_get_option(packet, code);
*curr = xmalloc_optname_optval(temp, &dhcp_optflags[i], opt_name);
putenv(*curr++);
- if (code == DHCP_SUBNET) {
+ if (code == DHCP_SUBNET && temp[-OPT_DATA + OPT_LEN] == 4) {
/* Subnet option: ... | CWE-125 | null | null |
7,004 | int udhcpc_main(int argc UNUSED_PARAM, char **argv)
{
uint8_t *message;
const char *str_V, *str_h, *str_F, *str_r;
IF_FEATURE_UDHCPC_ARPING(const char *str_a = "2000";)
IF_FEATURE_UDHCP_PORT(char *str_P;)
void *clientid_mac_ptr;
llist_t *list_O = NULL;
llist_t *list_x = NULL;
int tryagain_timeout = 20;
int dis... | +Info | 0 | int udhcpc_main(int argc UNUSED_PARAM, char **argv)
{
uint8_t *message;
const char *str_V, *str_h, *str_F, *str_r;
IF_FEATURE_UDHCPC_ARPING(const char *str_a = "2000";)
IF_FEATURE_UDHCP_PORT(char *str_P;)
void *clientid_mac_ptr;
llist_t *list_O = NULL;
llist_t *list_x = NULL;
int tryagain_timeout = 20;
int dis... | @@ -531,7 +531,7 @@ static char **fill_envp(struct dhcp_packet *packet)
temp = udhcp_get_option(packet, code);
*curr = xmalloc_optname_optval(temp, &dhcp_optflags[i], opt_name);
putenv(*curr++);
- if (code == DHCP_SUBNET) {
+ if (code == DHCP_SUBNET && temp[-OPT_DATA + OPT_LEN] == 4) {
/* Subnet option: ... | CWE-125 | null | null |
7,005 | static const char *valid_domain_label(const char *label)
{
unsigned char ch;
if (label[0] == '-')
return NULL;
for (;;) {
ch = *label;
if ((ch|0x20) < 'a' || (ch|0x20) > 'z') {
if (ch < '0' || ch > '9') {
if (ch == '\0' || ch == '.')
return label;
/* DNS allows only '-', but we are more permis... | +Info | 0 | static const char *valid_domain_label(const char *label)
{
unsigned char ch;
if (label[0] == '-')
return NULL;
for (;;) {
ch = *label;
if ((ch|0x20) < 'a' || (ch|0x20) > 'z') {
if (ch < '0' || ch > '9') {
if (ch == '\0' || ch == '.')
return label;
/* DNS allows only '-', but we are more permis... | @@ -531,7 +531,7 @@ static char **fill_envp(struct dhcp_packet *packet)
temp = udhcp_get_option(packet, code);
*curr = xmalloc_optname_optval(temp, &dhcp_optflags[i], opt_name);
putenv(*curr++);
- if (code == DHCP_SUBNET) {
+ if (code == DHCP_SUBNET && temp[-OPT_DATA + OPT_LEN] == 4) {
/* Subnet option: ... | CWE-125 | null | null |
7,006 | static NOINLINE char *xmalloc_optname_optval(uint8_t *option, const struct dhcp_optflag *optflag, const char *opt_name)
{
unsigned upper_length;
int len, type, optlen;
char *dest, *ret;
/* option points to OPT_DATA, need to go back to get OPT_LEN */
len = option[-OPT_DATA + OPT_LEN];
type = optflag->flags & OPT... | +Info | 0 | static NOINLINE char *xmalloc_optname_optval(uint8_t *option, const struct dhcp_optflag *optflag, const char *opt_name)
{
unsigned upper_length;
int len, type, optlen;
char *dest, *ret;
/* option points to OPT_DATA, need to go back to get OPT_LEN */
len = option[-OPT_DATA + OPT_LEN];
type = optflag->flags & OPT... | @@ -531,7 +531,7 @@ static char **fill_envp(struct dhcp_packet *packet)
temp = udhcp_get_option(packet, code);
*curr = xmalloc_optname_optval(temp, &dhcp_optflags[i], opt_name);
putenv(*curr++);
- if (code == DHCP_SUBNET) {
+ if (code == DHCP_SUBNET && temp[-OPT_DATA + OPT_LEN] == 4) {
/* Subnet option: ... | CWE-125 | null | null |
7,007 | static void __report_context_error(const char *fname, struct vrend_context *ctx, enum virgl_ctx_errors error, uint32_t value)
{
ctx->in_error = true;
ctx->last_error = error;
fprintf(stderr,"%s: context error reported %d \"%s\" %s %d\n", fname, ctx->ctx_id, ctx->debug_name, vrend_ctx_error_strings[error], valu... | DoS | 0 | static void __report_context_error(const char *fname, struct vrend_context *ctx, enum virgl_ctx_errors error, uint32_t value)
{
ctx->in_error = true;
ctx->last_error = error;
fprintf(stderr,"%s: context error reported %d \"%s\" %s %d\n", fname, ctx->ctx_id, ctx->debug_name, vrend_ctx_error_strings[error], valu... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,008 | static struct vrend_linked_shader_program *add_shader_program(struct vrend_context *ctx,
struct vrend_shader *vs,
struct vrend_shader *fs,
... | DoS | 0 | static struct vrend_linked_shader_program *add_shader_program(struct vrend_context *ctx,
struct vrend_shader *vs,
struct vrend_shader *fs,
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,009 | static bool check_iov_bounds(struct vrend_resource *res,
const struct vrend_transfer_info *info,
struct iovec *iov, int num_iovs)
{
GLuint send_size;
GLuint iovsize = vrend_get_iovec_size(iov, num_iovs);
GLuint valid_stride, valid_layer_stride;
/* v... | DoS | 0 | static bool check_iov_bounds(struct vrend_resource *res,
const struct vrend_transfer_info *info,
struct iovec *iov, int num_iovs)
{
GLuint send_size;
GLuint iovsize = vrend_get_iovec_size(iov, num_iovs);
GLuint valid_stride, valid_layer_stride;
/* v... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,010 | static int check_resource_valid(struct vrend_renderer_resource_create_args *args)
{
/* do not accept handle 0 */
if (args->handle == 0)
return -1;
/* limit the target */
if (args->target >= PIPE_MAX_TEXTURE_TYPES)
return -1;
if (args->format >= VIRGL_FORMAT_MAX)
return -1;
/* only... | DoS | 0 | static int check_resource_valid(struct vrend_renderer_resource_create_args *args)
{
/* do not accept handle 0 */
if (args->handle == 0)
return -1;
/* limit the target */
if (args->target >= PIPE_MAX_TEXTURE_TYPES)
return -1;
if (args->format >= VIRGL_FORMAT_MAX)
return -1;
/* only... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,011 | static inline int conv_dst_blend(int blend_factor)
{
if (blend_factor == PIPE_BLENDFACTOR_DST_ALPHA)
return PIPE_BLENDFACTOR_ONE;
if (blend_factor == PIPE_BLENDFACTOR_INV_DST_ALPHA)
return PIPE_BLENDFACTOR_ZERO;
return blend_factor;
}
| DoS | 0 | static inline int conv_dst_blend(int blend_factor)
{
if (blend_factor == PIPE_BLENDFACTOR_DST_ALPHA)
return PIPE_BLENDFACTOR_ONE;
if (blend_factor == PIPE_BLENDFACTOR_INV_DST_ALPHA)
return PIPE_BLENDFACTOR_ZERO;
return blend_factor;
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,012 | static inline int conv_shader_type(int type)
{
switch (type) {
case PIPE_SHADER_VERTEX: return GL_VERTEX_SHADER;
case PIPE_SHADER_FRAGMENT: return GL_FRAGMENT_SHADER;
case PIPE_SHADER_GEOMETRY: return GL_GEOMETRY_SHADER;
default:
return 0;
};
}
| DoS | 0 | static inline int conv_shader_type(int type)
{
switch (type) {
case PIPE_SHADER_VERTEX: return GL_VERTEX_SHADER;
case PIPE_SHADER_FRAGMENT: return GL_FRAGMENT_SHADER;
case PIPE_SHADER_GEOMETRY: return GL_GEOMETRY_SHADER;
default:
return 0;
};
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,013 | static inline GLenum convert_mag_filter(unsigned int filter)
{
if (filter == PIPE_TEX_FILTER_NEAREST)
return GL_NEAREST;
return GL_LINEAR;
}
| DoS | 0 | static inline GLenum convert_mag_filter(unsigned int filter)
{
if (filter == PIPE_TEX_FILTER_NEAREST)
return GL_NEAREST;
return GL_LINEAR;
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,014 | static inline GLenum convert_min_filter(unsigned int filter, unsigned int mip_filter)
{
if (mip_filter == PIPE_TEX_MIPFILTER_NONE)
return convert_mag_filter(filter);
else if (mip_filter == PIPE_TEX_MIPFILTER_LINEAR) {
if (filter == PIPE_TEX_FILTER_NEAREST)
return GL_NEAREST_MIPMAP_LINEAR;
... | DoS | 0 | static inline GLenum convert_min_filter(unsigned int filter, unsigned int mip_filter)
{
if (mip_filter == PIPE_TEX_MIPFILTER_NONE)
return convert_mag_filter(filter);
else if (mip_filter == PIPE_TEX_MIPFILTER_LINEAR) {
if (filter == PIPE_TEX_FILTER_NEAREST)
return GL_NEAREST_MIPMAP_LINEAR;
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,015 | static GLuint convert_wrap(int wrap)
{
switch(wrap){
case PIPE_TEX_WRAP_REPEAT: return GL_REPEAT;
case PIPE_TEX_WRAP_CLAMP: if (vrend_state.use_core_profile == false) return GL_CLAMP; else return GL_CLAMP_TO_EDGE;
case PIPE_TEX_WRAP_CLAMP_TO_EDGE: return GL_CLAMP_TO_EDGE;
case PIPE_TEX_WRAP_CLAMP_TO_BOR... | DoS | 0 | static GLuint convert_wrap(int wrap)
{
switch(wrap){
case PIPE_TEX_WRAP_REPEAT: return GL_REPEAT;
case PIPE_TEX_WRAP_CLAMP: if (vrend_state.use_core_profile == false) return GL_CLAMP; else return GL_CLAMP_TO_EDGE;
case PIPE_TEX_WRAP_CLAMP_TO_EDGE: return GL_CLAMP_TO_EDGE;
case PIPE_TEX_WRAP_CLAMP_TO_BOR... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,016 | static void flush_eventfd(int fd)
{
ssize_t len;
uint64_t value;
do {
len = read(fd, &value, sizeof(value));
} while ((len == -1 && errno == EINTR) || len == sizeof(value));
}
| DoS | 0 | static void flush_eventfd(int fd)
{
ssize_t len;
uint64_t value;
do {
len = read(fd, &value, sizeof(value));
} while ((len == -1 && errno == EINTR) || len == sizeof(value));
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,017 | static void free_fence_locked(struct vrend_fence *fence)
{
list_del(&fence->fences);
glDeleteSync(fence->syncobj);
free(fence);
}
| DoS | 0 | static void free_fence_locked(struct vrend_fence *fence)
{
list_del(&fence->fences);
glDeleteSync(fence->syncobj);
free(fence);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,018 | static GLenum get_gs_xfb_mode(GLenum mode)
{
switch (mode) {
case GL_POINTS:
return GL_POINTS;
case GL_LINE_STRIP:
return GL_LINES;
case GL_TRIANGLE_STRIP:
return GL_TRIANGLES;
default:
fprintf(stderr, "illegal gs transform feedback mode %d\n", mode);
return GL_POINTS;
}
... | DoS | 0 | static GLenum get_gs_xfb_mode(GLenum mode)
{
switch (mode) {
case GL_POINTS:
return GL_POINTS;
case GL_LINE_STRIP:
return GL_LINES;
case GL_TRIANGLE_STRIP:
return GL_TRIANGLES;
default:
fprintf(stderr, "illegal gs transform feedback mode %d\n", mode);
return GL_POINTS;
}
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,019 | static GLenum get_xfb_mode(GLenum mode)
{
switch (mode) {
case GL_POINTS:
return GL_POINTS;
case GL_TRIANGLES:
case GL_TRIANGLE_STRIP:
case GL_TRIANGLE_FAN:
case GL_QUADS:
case GL_QUAD_STRIP:
case GL_POLYGON:
return GL_TRIANGLES;
case GL_LINES:
case GL_LINE_LOOP:
case GL_LIN... | DoS | 0 | static GLenum get_xfb_mode(GLenum mode)
{
switch (mode) {
case GL_POINTS:
return GL_POINTS;
case GL_TRIANGLES:
case GL_TRIANGLE_STRIP:
case GL_TRIANGLE_FAN:
case GL_QUADS:
case GL_QUAD_STRIP:
case GL_POLYGON:
return GL_TRIANGLES;
case GL_LINES:
case GL_LINE_LOOP:
case GL_LIN... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,020 | static void iov_buffer_upload(void *cookie, uint32_t doff, void *src, int len)
{
struct virgl_sub_upload_data *d = cookie;
glBufferSubData(d->target, d->box->x + doff, len, src);
}
| DoS | 0 | static void iov_buffer_upload(void *cookie, uint32_t doff, void *src, int len)
{
struct virgl_sub_upload_data *d = cookie;
glBufferSubData(d->target, d->box->x + doff, len, src);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,021 | static inline bool is_dst_blend(int blend_factor)
{
return (blend_factor == PIPE_BLENDFACTOR_DST_ALPHA ||
blend_factor == PIPE_BLENDFACTOR_INV_DST_ALPHA);
}
| DoS | 0 | static inline bool is_dst_blend(int blend_factor)
{
return (blend_factor == PIPE_BLENDFACTOR_DST_ALPHA ||
blend_factor == PIPE_BLENDFACTOR_INV_DST_ALPHA);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,022 | static struct vrend_linked_shader_program *lookup_shader_program(struct vrend_context *ctx,
GLuint vs_id, GLuint fs_id, GLuint gs_id, bool dual_src)
{
struct vrend_linked_shader_program *ent;
LIST_FOR_EACH_ENTRY(ent, &ctx->sub->programs, head) {
... | DoS | 0 | static struct vrend_linked_shader_program *lookup_shader_program(struct vrend_context *ctx,
GLuint vs_id, GLuint fs_id, GLuint gs_id, bool dual_src)
{
struct vrend_linked_shader_program *ent;
LIST_FOR_EACH_ENTRY(ent, &ctx->sub->programs, head) {
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,023 | static inline const char *pipe_shader_to_prefix(int shader_type)
{
switch (shader_type) {
case PIPE_SHADER_VERTEX: return "vs";
case PIPE_SHADER_FRAGMENT: return "fs";
case PIPE_SHADER_GEOMETRY: return "gs";
default:
return NULL;
};
}
| DoS | 0 | static inline const char *pipe_shader_to_prefix(int shader_type)
{
switch (shader_type) {
case PIPE_SHADER_VERTEX: return "vs";
case PIPE_SHADER_FRAGMENT: return "fs";
case PIPE_SHADER_GEOMETRY: return "gs";
default:
return NULL;
};
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,024 | static void read_transfer_data(struct pipe_resource *res,
struct iovec *iov,
unsigned int num_iovs,
char *data,
uint32_t src_stride,
struct pipe_box *box,
... | DoS | 0 | static void read_transfer_data(struct pipe_resource *res,
struct iovec *iov,
unsigned int num_iovs,
char *data,
uint32_t src_stride,
struct pipe_box *box,
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,025 | static void set_stream_out_varyings(int prog_id, struct vrend_shader_info *sinfo)
{
struct pipe_stream_output_info *so = &sinfo->so_info;
char *varyings[PIPE_MAX_SHADER_OUTPUTS*2];
int i, j;
int n_outputs = 0;
int last_buffer = 0;
char *start_skip;
int buf_offset = 0;
int skip;
if (!so->num_o... | DoS | 0 | static void set_stream_out_varyings(int prog_id, struct vrend_shader_info *sinfo)
{
struct pipe_stream_output_info *so = &sinfo->so_info;
char *varyings[PIPE_MAX_SHADER_OUTPUTS*2];
int i, j;
int n_outputs = 0;
int last_buffer = 0;
char *start_skip;
int buf_offset = 0;
int skip;
if (!so->num_o... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,026 | static inline bool should_invert_viewport(struct vrend_context *ctx)
{
/* if we have a negative viewport then gallium wanted to invert it,
however since we are rendering to GL FBOs we need to invert it
again unless we are rendering upside down already
- confused?
so if gallium asks for a nega... | DoS | 0 | static inline bool should_invert_viewport(struct vrend_context *ctx)
{
/* if we have a negative viewport then gallium wanted to invert it,
however since we are rendering to GL FBOs we need to invert it
again unless we are rendering upside down already
- confused?
so if gallium asks for a nega... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,027 | static int thread_sync(void *arg)
{
virgl_gl_context gl_context = vrend_state.sync_context;
struct vrend_fence *fence, *stor;
pipe_mutex_lock(vrend_state.fence_mutex);
vrend_clicbs->make_current(0, gl_context);
while (!vrend_state.stop_sync_thread) {
if (LIST_IS_EMPTY(&vrend_state.fence_wait_list... | DoS | 0 | static int thread_sync(void *arg)
{
virgl_gl_context gl_context = vrend_state.sync_context;
struct vrend_fence *fence, *stor;
pipe_mutex_lock(vrend_state.fence_mutex);
vrend_clicbs->make_current(0, gl_context);
while (!vrend_state.stop_sync_thread) {
if (LIST_IS_EMPTY(&vrend_state.fence_wait_list... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,028 | static inline GLenum to_gl_swizzle(int swizzle)
{
switch (swizzle) {
case PIPE_SWIZZLE_RED: return GL_RED;
case PIPE_SWIZZLE_GREEN: return GL_GREEN;
case PIPE_SWIZZLE_BLUE: return GL_BLUE;
case PIPE_SWIZZLE_ALPHA: return GL_ALPHA;
case PIPE_SWIZZLE_ZERO: return GL_ZERO;
case PIPE_SWIZZLE_ONE: retur... | DoS | 0 | static inline GLenum to_gl_swizzle(int swizzle)
{
switch (swizzle) {
case PIPE_SWIZZLE_RED: return GL_RED;
case PIPE_SWIZZLE_GREEN: return GL_GREEN;
case PIPE_SWIZZLE_BLUE: return GL_BLUE;
case PIPE_SWIZZLE_ALPHA: return GL_ALPHA;
case PIPE_SWIZZLE_ZERO: return GL_ZERO;
case PIPE_SWIZZLE_ONE: retur... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,029 | static GLenum translate_blend_factor(uint32_t pipe_factor)
{
switch (pipe_factor) {
case PIPE_BLENDFACTOR_ONE: return GL_ONE;
case PIPE_BLENDFACTOR_SRC_COLOR: return GL_SRC_COLOR;
case PIPE_BLENDFACTOR_SRC_ALPHA: return GL_SRC_ALPHA;
case PIPE_BLENDFACTOR_DST_COLOR: return GL_DST_COLOR;
case PIPE_BLE... | DoS | 0 | static GLenum translate_blend_factor(uint32_t pipe_factor)
{
switch (pipe_factor) {
case PIPE_BLENDFACTOR_ONE: return GL_ONE;
case PIPE_BLENDFACTOR_SRC_COLOR: return GL_SRC_COLOR;
case PIPE_BLENDFACTOR_SRC_ALPHA: return GL_SRC_ALPHA;
case PIPE_BLENDFACTOR_DST_COLOR: return GL_DST_COLOR;
case PIPE_BLE... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,030 | static GLenum translate_blend_func(uint32_t pipe_blend)
{
switch(pipe_blend){
case PIPE_BLEND_ADD: return GL_FUNC_ADD;
case PIPE_BLEND_SUBTRACT: return GL_FUNC_SUBTRACT;
case PIPE_BLEND_REVERSE_SUBTRACT: return GL_FUNC_REVERSE_SUBTRACT;
case PIPE_BLEND_MIN: return GL_MIN;
case PIPE_BLEND_MAX: return G... | DoS | 0 | static GLenum translate_blend_func(uint32_t pipe_blend)
{
switch(pipe_blend){
case PIPE_BLEND_ADD: return GL_FUNC_ADD;
case PIPE_BLEND_SUBTRACT: return GL_FUNC_SUBTRACT;
case PIPE_BLEND_REVERSE_SUBTRACT: return GL_FUNC_REVERSE_SUBTRACT;
case PIPE_BLEND_MIN: return GL_MIN;
case PIPE_BLEND_MAX: return G... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,031 | translate_logicop(GLuint pipe_logicop)
{
switch (pipe_logicop) {
#define CASE(x) case PIPE_LOGICOP_##x: return GL_##x
CASE(CLEAR);
CASE(NOR);
CASE(AND_INVERTED);
CASE(COPY_INVERTED);
CASE(AND_REVERSE);
CASE(INVERT);
CASE(XOR);
CASE(NAND);
CASE(AND);
CASE(EQ... | DoS | 0 | translate_logicop(GLuint pipe_logicop)
{
switch (pipe_logicop) {
#define CASE(x) case PIPE_LOGICOP_##x: return GL_##x
CASE(CLEAR);
CASE(NOR);
CASE(AND_INVERTED);
CASE(COPY_INVERTED);
CASE(AND_REVERSE);
CASE(INVERT);
CASE(XOR);
CASE(NAND);
CASE(AND);
CASE(EQ... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,032 | translate_stencil_op(GLuint op)
{
switch (op) {
#define CASE(x) case PIPE_STENCIL_OP_##x: return GL_##x
CASE(KEEP);
CASE(ZERO);
CASE(REPLACE);
CASE(INCR);
CASE(DECR);
CASE(INCR_WRAP);
CASE(DECR_WRAP);
CASE(INVERT);
default:
assert("invalid stencilop token()" =... | DoS | 0 | translate_stencil_op(GLuint op)
{
switch (op) {
#define CASE(x) case PIPE_STENCIL_OP_##x: return GL_##x
CASE(KEEP);
CASE(ZERO);
CASE(REPLACE);
CASE(INCR);
CASE(DECR);
CASE(INCR_WRAP);
CASE(DECR_WRAP);
CASE(INVERT);
default:
assert("invalid stencilop token()" =... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,033 | static void vrend_alpha_test_enable(struct vrend_context *ctx, bool alpha_test_enable)
{
if (vrend_state.use_core_profile) {
/* handled in shaders */
return;
}
if (ctx->sub->alpha_test_enabled != alpha_test_enable) {
ctx->sub->alpha_test_enabled = alpha_test_enable;
if (alpha_test_enabl... | DoS | 0 | static void vrend_alpha_test_enable(struct vrend_context *ctx, bool alpha_test_enable)
{
if (vrend_state.use_core_profile) {
/* handled in shaders */
return;
}
if (ctx->sub->alpha_test_enabled != alpha_test_enable) {
ctx->sub->alpha_test_enabled = alpha_test_enable;
if (alpha_test_enabl... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,034 | static void vrend_apply_sampler_state(struct vrend_context *ctx,
struct vrend_resource *res,
uint32_t shader_type,
int id,
int sampler_id,
... | DoS | 0 | static void vrend_apply_sampler_state(struct vrend_context *ctx,
struct vrend_resource *res,
uint32_t shader_type,
int id,
int sampler_id,
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,035 | void vrend_begin_query(struct vrend_context *ctx, uint32_t handle)
{
struct vrend_query *q;
q = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_QUERY);
if (!q)
return;
if (q->gltype == GL_TIMESTAMP)
return;
glBeginQuery(q->gltype, q->id);
}
| DoS | 0 | void vrend_begin_query(struct vrend_context *ctx, uint32_t handle)
{
struct vrend_query *q;
q = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_QUERY);
if (!q)
return;
if (q->gltype == GL_TIMESTAMP)
return;
glBeginQuery(q->gltype, q->id);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,036 | void vrend_bind_sampler_states(struct vrend_context *ctx,
uint32_t shader_type,
uint32_t start_slot,
uint32_t num_states,
uint32_t *handles)
{
int i;
struct vrend_sampler_state *state;
i... | DoS | 0 | void vrend_bind_sampler_states(struct vrend_context *ctx,
uint32_t shader_type,
uint32_t start_slot,
uint32_t num_states,
uint32_t *handles)
{
int i;
struct vrend_sampler_state *state;
i... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,037 | void vrend_bind_shader(struct vrend_context *ctx,
uint32_t handle, uint32_t type)
{
struct vrend_shader_selector *sel;
if (type > PIPE_SHADER_GEOMETRY)
return;
if (handle == 0) {
ctx->sub->shader_dirty = true;
vrend_shader_state_reference(&ctx->sub->shaders[type], NUL... | DoS | 0 | void vrend_bind_shader(struct vrend_context *ctx,
uint32_t handle, uint32_t type)
{
struct vrend_shader_selector *sel;
if (type > PIPE_SHADER_GEOMETRY)
return;
if (handle == 0) {
ctx->sub->shader_dirty = true;
vrend_shader_state_reference(&ctx->sub->shaders[type], NUL... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,038 | void vrend_bind_vertex_elements_state(struct vrend_context *ctx,
uint32_t handle)
{
struct vrend_vertex_element_array *v;
if (!handle) {
ctx->sub->ve = NULL;
return;
}
v = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_VERTEX_ELEMENTS);
... | DoS | 0 | void vrend_bind_vertex_elements_state(struct vrend_context *ctx,
uint32_t handle)
{
struct vrend_vertex_element_array *v;
if (!handle) {
ctx->sub->ve = NULL;
return;
}
v = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_VERTEX_ELEMENTS);
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,039 | static void vrend_blend_enable(struct vrend_context *ctx, bool blend_enable)
{
if (ctx->sub->blend_enabled != blend_enable) {
ctx->sub->blend_enabled = blend_enable;
if (blend_enable)
glEnable(GL_BLEND);
else
glDisable(GL_BLEND);
}
}
| DoS | 0 | static void vrend_blend_enable(struct vrend_context *ctx, bool blend_enable)
{
if (ctx->sub->blend_enabled != blend_enable) {
ctx->sub->blend_enabled = blend_enable;
if (blend_enable)
glEnable(GL_BLEND);
else
glDisable(GL_BLEND);
}
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,040 | static bool vrend_check_query(struct vrend_query *query)
{
uint64_t result;
struct virgl_host_query_state *state;
bool ret;
ret = vrend_get_one_query_result(query->id, false, &result);
if (ret == false)
return false;
state = (struct virgl_host_query_state *)query->res->ptr;
state->result = ... | DoS | 0 | static bool vrend_check_query(struct vrend_query *query)
{
uint64_t result;
struct virgl_host_query_state *state;
bool ret;
ret = vrend_get_one_query_result(query->id, false, &result);
if (ret == false)
return false;
state = (struct virgl_host_query_state *)query->res->ptr;
state->result = ... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,041 | static bool vrend_compile_shader(struct vrend_context *ctx,
struct vrend_shader *shader)
{
GLint param;
glShaderSource(shader->id, 1, (const char **)&shader->glsl_prog, NULL);
glCompileShader(shader->id);
glGetShaderiv(shader->id, GL_COMPILE_STATUS, ¶m);
if (param == ... | DoS | 0 | static bool vrend_compile_shader(struct vrend_context *ctx,
struct vrend_shader *shader)
{
GLint param;
glShaderSource(shader->id, 1, (const char **)&shader->glsl_prog, NULL);
glCompileShader(shader->id);
glGetShaderiv(shader->id, GL_COMPILE_STATUS, ¶m);
if (param == ... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,042 | struct vrend_context *vrend_create_context(int id, uint32_t nlen, const char *debug_name)
{
struct vrend_context *grctx = CALLOC_STRUCT(vrend_context);
if (!grctx)
return NULL;
if (nlen && debug_name) {
strncpy(grctx->debug_name, debug_name, 64);
}
grctx->ctx_id = id;
list_inithead(&gr... | DoS | 0 | struct vrend_context *vrend_create_context(int id, uint32_t nlen, const char *debug_name)
{
struct vrend_context *grctx = CALLOC_STRUCT(vrend_context);
if (!grctx)
return NULL;
if (nlen && debug_name) {
strncpy(grctx->debug_name, debug_name, 64);
}
grctx->ctx_id = id;
list_inithead(&gr... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,043 | int vrend_create_query(struct vrend_context *ctx, uint32_t handle,
uint32_t query_type, uint32_t query_index,
uint32_t res_handle, uint32_t offset)
{
struct vrend_query *q;
struct vrend_resource *res;
uint32_t ret_handle;
res = vrend_renderer_ctx_res_lookup(ctx,... | DoS | 0 | int vrend_create_query(struct vrend_context *ctx, uint32_t handle,
uint32_t query_type, uint32_t query_index,
uint32_t res_handle, uint32_t offset)
{
struct vrend_query *q;
struct vrend_resource *res;
uint32_t ret_handle;
res = vrend_renderer_ctx_res_lookup(ctx,... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,044 | int vrend_create_sampler_view(struct vrend_context *ctx,
uint32_t handle,
uint32_t res_handle, uint32_t format,
uint32_t val0, uint32_t val1, uint32_t swizzle_packed)
{
struct vrend_sampler_view *view;
struct vrend_resource ... | DoS | 0 | int vrend_create_sampler_view(struct vrend_context *ctx,
uint32_t handle,
uint32_t res_handle, uint32_t format,
uint32_t val0, uint32_t val1, uint32_t swizzle_packed)
{
struct vrend_sampler_view *view;
struct vrend_resource ... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,045 | static void *vrend_create_shader_state(struct vrend_context *ctx,
const struct pipe_stream_output_info *so_info,
unsigned pipe_shader_type)
{
struct vrend_shader_selector *sel = CALLOC_STRUCT(vrend_shader_selector);
if (!sel)
ret... | DoS | 0 | static void *vrend_create_shader_state(struct vrend_context *ctx,
const struct pipe_stream_output_info *so_info,
unsigned pipe_shader_type)
{
struct vrend_shader_selector *sel = CALLOC_STRUCT(vrend_shader_selector);
if (!sel)
ret... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,046 | int vrend_create_so_target(struct vrend_context *ctx,
uint32_t handle,
uint32_t res_handle,
uint32_t buffer_offset,
uint32_t buffer_size)
{
struct vrend_so_target *target;
struct vrend_resource *res;
int... | DoS | 0 | int vrend_create_so_target(struct vrend_context *ctx,
uint32_t handle,
uint32_t res_handle,
uint32_t buffer_offset,
uint32_t buffer_size)
{
struct vrend_so_target *target;
struct vrend_resource *res;
int... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,047 | int vrend_create_surface(struct vrend_context *ctx,
uint32_t handle,
uint32_t res_handle, uint32_t format,
uint32_t val0, uint32_t val1)
{
struct vrend_surface *surf;
struct vrend_resource *res;
uint32_t ret_handle;
if (format >= PI... | DoS | 0 | int vrend_create_surface(struct vrend_context *ctx,
uint32_t handle,
uint32_t res_handle, uint32_t format,
uint32_t val0, uint32_t val1)
{
struct vrend_surface *surf;
struct vrend_resource *res;
uint32_t ret_handle;
if (format >= PI... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,048 | static void vrend_depth_test_enable(struct vrend_context *ctx, bool depth_test_enable)
{
if (ctx->sub->depth_test_enabled != depth_test_enable) {
ctx->sub->depth_test_enabled = depth_test_enable;
if (depth_test_enable)
glEnable(GL_DEPTH_TEST);
else
glDisable(GL_DEPTH_TEST);
}
}... | DoS | 0 | static void vrend_depth_test_enable(struct vrend_context *ctx, bool depth_test_enable)
{
if (ctx->sub->depth_test_enabled != depth_test_enable) {
ctx->sub->depth_test_enabled = depth_test_enable;
if (depth_test_enable)
glEnable(GL_DEPTH_TEST);
else
glDisable(GL_DEPTH_TEST);
}
}... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,049 | static void vrend_destroy_program(struct vrend_linked_shader_program *ent)
{
int i;
glDeleteProgram(ent->id);
list_del(&ent->head);
for (i = PIPE_SHADER_VERTEX; i <= PIPE_SHADER_GEOMETRY; i++) {
if (ent->ss[i])
list_del(&ent->sl[i]);
free(ent->shadow_samp_mask_locs[i]);
free(ent-... | DoS | 0 | static void vrend_destroy_program(struct vrend_linked_shader_program *ent)
{
int i;
glDeleteProgram(ent->id);
list_del(&ent->head);
for (i = PIPE_SHADER_VERTEX; i <= PIPE_SHADER_GEOMETRY; i++) {
if (ent->ss[i])
list_del(&ent->sl[i]);
free(ent->shadow_samp_mask_locs[i]);
free(ent-... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,050 | static void vrend_destroy_query(struct vrend_query *query)
{
vrend_resource_reference(&query->res, NULL);
list_del(&query->waiting_queries);
glDeleteQueries(1, &query->id);
free(query);
}
| DoS | 0 | static void vrend_destroy_query(struct vrend_query *query)
{
vrend_resource_reference(&query->res, NULL);
list_del(&query->waiting_queries);
glDeleteQueries(1, &query->id);
free(query);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,051 | static void vrend_destroy_resource_object(void *obj_ptr)
{
struct vrend_resource *res = obj_ptr;
if (pipe_reference(&res->base.reference, NULL))
vrend_renderer_resource_destroy(res, false);
}
| DoS | 0 | static void vrend_destroy_resource_object(void *obj_ptr)
{
struct vrend_resource *res = obj_ptr;
if (pipe_reference(&res->base.reference, NULL))
vrend_renderer_resource_destroy(res, false);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,052 | static void vrend_destroy_sampler_state_object(void *obj_ptr)
{
struct vrend_sampler_state *state = obj_ptr;
glDeleteSamplers(1, &state->id);
FREE(state);
}
| DoS | 0 | static void vrend_destroy_sampler_state_object(void *obj_ptr)
{
struct vrend_sampler_state *state = obj_ptr;
glDeleteSamplers(1, &state->id);
FREE(state);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,053 | static void vrend_destroy_sampler_view(struct vrend_sampler_view *samp)
{
vrend_resource_reference(&samp->texture, NULL);
free(samp);
}
| DoS | 0 | static void vrend_destroy_sampler_view(struct vrend_sampler_view *samp)
{
vrend_resource_reference(&samp->texture, NULL);
free(samp);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,054 | static void vrend_destroy_sampler_view_object(void *obj_ptr)
{
struct vrend_sampler_view *samp = obj_ptr;
vrend_sampler_view_reference(&samp, NULL);
}
| DoS | 0 | static void vrend_destroy_sampler_view_object(void *obj_ptr)
{
struct vrend_sampler_view *samp = obj_ptr;
vrend_sampler_view_reference(&samp, NULL);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,055 | static void vrend_destroy_shader_object(void *obj_ptr)
{
struct vrend_shader_selector *state = obj_ptr;
vrend_shader_state_reference(&state, NULL);
}
| DoS | 0 | static void vrend_destroy_shader_object(void *obj_ptr)
{
struct vrend_shader_selector *state = obj_ptr;
vrend_shader_state_reference(&state, NULL);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,056 | static void vrend_destroy_shader_selector(struct vrend_shader_selector *sel)
{
struct vrend_shader *p = sel->current, *c;
int i;
while (p) {
c = p->next_variant;
vrend_shader_destroy(p);
p = c;
}
if (sel->sinfo.so_names)
for (i = 0; i < sel->sinfo.so_info.num_outputs; i++)
... | DoS | 0 | static void vrend_destroy_shader_selector(struct vrend_shader_selector *sel)
{
struct vrend_shader *p = sel->current, *c;
int i;
while (p) {
c = p->next_variant;
vrend_shader_destroy(p);
p = c;
}
if (sel->sinfo.so_names)
for (i = 0; i < sel->sinfo.so_info.num_outputs; i++)
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,057 | static void vrend_destroy_so_target(struct vrend_so_target *target)
{
vrend_resource_reference(&target->buffer, NULL);
free(target);
}
| DoS | 0 | static void vrend_destroy_so_target(struct vrend_so_target *target)
{
vrend_resource_reference(&target->buffer, NULL);
free(target);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,058 | static void vrend_destroy_so_target_object(void *obj_ptr)
{
struct vrend_so_target *target = obj_ptr;
struct vrend_sub_context *sub_ctx = target->sub_ctx;
struct vrend_streamout_object *obj, *tmp;
bool found;
int i;
LIST_FOR_EACH_ENTRY_SAFE(obj, tmp, &sub_ctx->streamout_list, head) {
found = fa... | DoS | 0 | static void vrend_destroy_so_target_object(void *obj_ptr)
{
struct vrend_so_target *target = obj_ptr;
struct vrend_sub_context *sub_ctx = target->sub_ctx;
struct vrend_streamout_object *obj, *tmp;
bool found;
int i;
LIST_FOR_EACH_ENTRY_SAFE(obj, tmp, &sub_ctx->streamout_list, head) {
found = fa... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,059 | static void vrend_destroy_streamout_object(struct vrend_streamout_object *obj)
{
int i;
list_del(&obj->head);
for (i = 0; i < obj->num_targets; i++)
vrend_so_target_reference(&obj->so_targets[i], NULL);
if (vrend_state.have_tf2)
glDeleteTransformFeedbacks(1, &obj->id);
FREE(obj);
}
| DoS | 0 | static void vrend_destroy_streamout_object(struct vrend_streamout_object *obj)
{
int i;
list_del(&obj->head);
for (i = 0; i < obj->num_targets; i++)
vrend_so_target_reference(&obj->so_targets[i], NULL);
if (vrend_state.have_tf2)
glDeleteTransformFeedbacks(1, &obj->id);
FREE(obj);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,060 | static void vrend_destroy_sub_context(struct vrend_sub_context *sub)
{
int i, j;
struct vrend_streamout_object *obj, *tmp;
if (sub->fb_id)
glDeleteFramebuffers(1, &sub->fb_id);
if (sub->blit_fb_ids[0])
glDeleteFramebuffers(2, sub->blit_fb_ids);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
... | DoS | 0 | static void vrend_destroy_sub_context(struct vrend_sub_context *sub)
{
int i, j;
struct vrend_streamout_object *obj, *tmp;
if (sub->fb_id)
glDeleteFramebuffers(1, &sub->fb_id);
if (sub->blit_fb_ids[0])
glDeleteFramebuffers(2, sub->blit_fb_ids);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,061 | static void vrend_destroy_surface(struct vrend_surface *surf)
{
vrend_resource_reference(&surf->texture, NULL);
free(surf);
}
| DoS | 0 | static void vrend_destroy_surface(struct vrend_surface *surf)
{
vrend_resource_reference(&surf->texture, NULL);
free(surf);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,062 | static void vrend_destroy_surface_object(void *obj_ptr)
{
struct vrend_surface *surface = obj_ptr;
vrend_surface_reference(&surface, NULL);
}
| DoS | 0 | static void vrend_destroy_surface_object(void *obj_ptr)
{
struct vrend_surface *surface = obj_ptr;
vrend_surface_reference(&surface, NULL);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,063 | static void vrend_destroy_vertex_elements_object(void *obj_ptr)
{
struct vrend_vertex_element_array *v = obj_ptr;
if (vrend_state.have_vertex_attrib_binding) {
glDeleteVertexArrays(1, &v->id);
}
FREE(v);
}
| DoS | 0 | static void vrend_destroy_vertex_elements_object(void *obj_ptr)
{
struct vrend_vertex_element_array *v = obj_ptr;
if (vrend_state.have_vertex_attrib_binding) {
glDeleteVertexArrays(1, &v->id);
}
FREE(v);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,064 | static void vrend_draw_bind_samplers(struct vrend_context *ctx)
{
int sampler_id;
int i;
int shader_type;
sampler_id = 0;
for (shader_type = PIPE_SHADER_VERTEX; shader_type <= ctx->sub->last_shader_idx; shader_type++) {
int index = 0;
for (i = 0; i < ctx->sub->views[shader_type].num_views; i... | DoS | 0 | static void vrend_draw_bind_samplers(struct vrend_context *ctx)
{
int sampler_id;
int i;
int shader_type;
sampler_id = 0;
for (shader_type = PIPE_SHADER_VERTEX; shader_type <= ctx->sub->last_shader_idx; shader_type++) {
int index = 0;
for (i = 0; i < ctx->sub->views[shader_type].num_views; i... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,065 | static void vrend_draw_bind_ubo(struct vrend_context *ctx)
{
int i;
int ubo_id;
int shader_type;
ubo_id = 0;
for (shader_type = PIPE_SHADER_VERTEX; shader_type <= ctx->sub->last_shader_idx; shader_type++) {
uint32_t mask;
int shader_ubo_idx = 0;
struct pipe_constant_buffer *cb;
s... | DoS | 0 | static void vrend_draw_bind_ubo(struct vrend_context *ctx)
{
int i;
int ubo_id;
int shader_type;
ubo_id = 0;
for (shader_type = PIPE_SHADER_VERTEX; shader_type <= ctx->sub->last_shader_idx; shader_type++) {
uint32_t mask;
int shader_ubo_idx = 0;
struct pipe_constant_buffer *cb;
s... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,066 | static void vrend_draw_bind_vertex_binding(struct vrend_context *ctx,
struct vrend_vertex_element_array *va)
{
int i;
glBindVertexArray(va->id);
if (ctx->sub->vbo_dirty) {
for (i = 0; i < ctx->sub->num_vbos; i++) {
struct vrend_resource *res = (struct... | DoS | 0 | static void vrend_draw_bind_vertex_binding(struct vrend_context *ctx,
struct vrend_vertex_element_array *va)
{
int i;
glBindVertexArray(va->id);
if (ctx->sub->vbo_dirty) {
for (i = 0; i < ctx->sub->num_vbos; i++) {
struct vrend_resource *res = (struct... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,067 | static void vrend_draw_bind_vertex_legacy(struct vrend_context *ctx,
struct vrend_vertex_element_array *va)
{
uint32_t num_enable;
uint32_t enable_bitmask;
uint32_t disable_bitmask;
int i;
num_enable = va->count;
enable_bitmask = 0;
disable_bitmask = ~((1u... | DoS | 0 | static void vrend_draw_bind_vertex_legacy(struct vrend_context *ctx,
struct vrend_vertex_element_array *va)
{
uint32_t num_enable;
uint32_t enable_bitmask;
uint32_t disable_bitmask;
int i;
num_enable = va->count;
enable_bitmask = 0;
disable_bitmask = ~((1u... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,068 | void vrend_end_query(struct vrend_context *ctx, uint32_t handle)
{
struct vrend_query *q;
q = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_QUERY);
if (!q)
return;
if (vrend_is_timer_query(q->gltype)) {
if (q->gltype == GL_TIMESTAMP)
glQueryCounter(q->id, q->gltype);
... | DoS | 0 | void vrend_end_query(struct vrend_context *ctx, uint32_t handle)
{
struct vrend_query *q;
q = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_QUERY);
if (!q)
return;
if (vrend_is_timer_query(q->gltype)) {
if (q->gltype == GL_TIMESTAMP)
glQueryCounter(q->id, q->gltype);
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,069 | void vrend_fb_bind_texture(struct vrend_resource *res,
int idx,
uint32_t level, uint32_t layer)
{
const struct util_format_description *desc = util_format_description(res->base.format);
GLenum attachment = GL_COLOR_ATTACHMENT0_EXT + idx;
if (vrend_format_i... | DoS | 0 | void vrend_fb_bind_texture(struct vrend_resource *res,
int idx,
uint32_t level, uint32_t layer)
{
const struct util_format_description *desc = util_format_description(res->base.format);
GLenum attachment = GL_COLOR_ATTACHMENT0_EXT + idx;
if (vrend_format_i... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,070 | static inline void vrend_fill_shader_key(struct vrend_context *ctx,
struct vrend_shader_key *key)
{
if (vrend_state.use_core_profile == true) {
int i;
bool add_alpha_test = true;
key->cbufs_are_a8_bitmask = 0;
for (i = 0; i < ctx->sub->nr_cbufs; i++) {... | DoS | 0 | static inline void vrend_fill_shader_key(struct vrend_context *ctx,
struct vrend_shader_key *key)
{
if (vrend_state.use_core_profile == true) {
int i;
bool add_alpha_test = true;
key->cbufs_are_a8_bitmask = 0;
for (i = 0; i < ctx->sub->nr_cbufs; i++) {... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,071 | static void vrend_finish_context_switch(struct vrend_context *ctx)
{
if (ctx->ctx_switch_pending == false)
return;
ctx->ctx_switch_pending = false;
if (vrend_state.current_hw_ctx == ctx)
return;
vrend_state.current_hw_ctx = ctx;
vrend_clicbs->make_current(0, ctx->sub->gl_context);
}
| DoS | 0 | static void vrend_finish_context_switch(struct vrend_context *ctx)
{
if (ctx->ctx_switch_pending == false)
return;
ctx->ctx_switch_pending = false;
if (vrend_state.current_hw_ctx == ctx)
return;
vrend_state.current_hw_ctx = ctx;
vrend_clicbs->make_current(0, ctx->sub->gl_context);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,072 | static int vrend_finish_shader(struct vrend_context *ctx,
struct vrend_shader_selector *sel,
const struct tgsi_token *tokens)
{
int r;
sel->tokens = tgsi_dup_tokens(tokens);
r = vrend_shader_select(ctx, sel, NULL);
if (r) {
return EINVAL;... | DoS | 0 | static int vrend_finish_shader(struct vrend_context *ctx,
struct vrend_shader_selector *sel,
const struct tgsi_token *tokens)
{
int r;
sel->tokens = tgsi_dup_tokens(tokens);
r = vrend_shader_select(ctx, sel, NULL);
if (r) {
return EINVAL;... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,073 | static inline bool vrend_format_can_render(enum virgl_formats format)
{
return tex_conv_table[format].bindings & VREND_BIND_RENDER;
}
| DoS | 0 | static inline bool vrend_format_can_render(enum virgl_formats format)
{
return tex_conv_table[format].bindings & VREND_BIND_RENDER;
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,074 | static inline bool vrend_format_can_sample(enum virgl_formats format)
{
return tex_conv_table[format].bindings & VREND_BIND_SAMPLER;
}
| DoS | 0 | static inline bool vrend_format_can_sample(enum virgl_formats format)
{
return tex_conv_table[format].bindings & VREND_BIND_SAMPLER;
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,075 | static inline bool vrend_format_is_ds(enum virgl_formats format)
{
return tex_conv_table[format].bindings & VREND_BIND_DEPTHSTENCIL;
}
| DoS | 0 | static inline bool vrend_format_is_ds(enum virgl_formats format)
{
return tex_conv_table[format].bindings & VREND_BIND_DEPTHSTENCIL;
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,076 | bool vrend_format_is_emulated_alpha(enum virgl_formats format)
{
if (!vrend_state.use_core_profile)
return false;
return (format == VIRGL_FORMAT_A8_UNORM ||
format == VIRGL_FORMAT_A16_UNORM);
}
| DoS | 0 | bool vrend_format_is_emulated_alpha(enum virgl_formats format)
{
if (!vrend_state.use_core_profile)
return false;
return (format == VIRGL_FORMAT_A8_UNORM ||
format == VIRGL_FORMAT_A16_UNORM);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,077 | static void vrend_free_programs(struct vrend_sub_context *sub)
{
struct vrend_linked_shader_program *ent, *tmp;
if (LIST_IS_EMPTY(&sub->programs))
return;
LIST_FOR_EACH_ENTRY_SAFE(ent, tmp, &sub->programs, head) {
vrend_destroy_program(ent);
}
}
| DoS | 0 | static void vrend_free_programs(struct vrend_sub_context *sub)
{
struct vrend_linked_shader_program *ent, *tmp;
if (LIST_IS_EMPTY(&sub->programs))
return;
LIST_FOR_EACH_ENTRY_SAFE(ent, tmp, &sub->programs, head) {
vrend_destroy_program(ent);
}
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,078 | static void vrend_free_sync_thread(void)
{
if (!vrend_state.sync_thread)
return;
pipe_mutex_lock(vrend_state.fence_mutex);
vrend_state.stop_sync_thread = true;
pipe_mutex_unlock(vrend_state.fence_mutex);
pipe_condvar_signal(vrend_state.fence_cond);
pipe_thread_wait(vrend_state.sync_thread);
... | DoS | 0 | static void vrend_free_sync_thread(void)
{
if (!vrend_state.sync_thread)
return;
pipe_mutex_lock(vrend_state.fence_mutex);
vrend_state.stop_sync_thread = true;
pipe_mutex_unlock(vrend_state.fence_mutex);
pipe_condvar_signal(vrend_state.fence_cond);
pipe_thread_wait(vrend_state.sync_thread);
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,079 | static bool vrend_get_one_query_result(GLuint query_id, bool use_64, uint64_t *result)
{
GLint ready;
GLuint passed;
GLuint64 pass64;
glGetQueryObjectiv(query_id, GL_QUERY_RESULT_AVAILABLE_ARB, &ready);
if (!ready)
return false;
if (use_64) {
glGetQueryObjectui64v(query_id, GL_QUERY_RES... | DoS | 0 | static bool vrend_get_one_query_result(GLuint query_id, bool use_64, uint64_t *result)
{
GLint ready;
GLuint passed;
GLuint64 pass64;
glGetQueryObjectiv(query_id, GL_QUERY_RESULT_AVAILABLE_ARB, &ready);
if (!ready)
return false;
if (use_64) {
glGetQueryObjectui64v(query_id, GL_QUERY_RES... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,080 | void vrend_get_query_result(struct vrend_context *ctx, uint32_t handle,
uint32_t wait)
{
struct vrend_query *q;
bool ret;
q = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_QUERY);
if (!q)
return;
ret = vrend_check_query(q);
if (ret == false)
... | DoS | 0 | void vrend_get_query_result(struct vrend_context *ctx, uint32_t handle,
uint32_t wait)
{
struct vrend_query *q;
bool ret;
q = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_QUERY);
if (!q)
return;
ret = vrend_check_query(q);
if (ret == false)
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,081 | static void vrend_hw_emit_blend(struct vrend_context *ctx, struct pipe_blend_state *state)
{
if (state->logicop_enable != ctx->sub->hw_blend_state.logicop_enable) {
ctx->sub->hw_blend_state.logicop_enable = state->logicop_enable;
if (state->logicop_enable) {
glEnable(GL_COLOR_LOGIC_OP);
... | DoS | 0 | static void vrend_hw_emit_blend(struct vrend_context *ctx, struct pipe_blend_state *state)
{
if (state->logicop_enable != ctx->sub->hw_blend_state.logicop_enable) {
ctx->sub->hw_blend_state.logicop_enable = state->logicop_enable;
if (state->logicop_enable) {
glEnable(GL_COLOR_LOGIC_OP);
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,082 | static void vrend_hw_emit_dsa(struct vrend_context *ctx)
{
struct pipe_depth_stencil_alpha_state *state = &ctx->sub->dsa_state;
if (state->depth.enabled) {
vrend_depth_test_enable(ctx, true);
glDepthFunc(GL_NEVER + state->depth.func);
if (state->depth.writemask)
glDepthMask(GL_TRUE);
... | DoS | 0 | static void vrend_hw_emit_dsa(struct vrend_context *ctx)
{
struct pipe_depth_stencil_alpha_state *state = &ctx->sub->dsa_state;
if (state->depth.enabled) {
vrend_depth_test_enable(ctx, true);
glDepthFunc(GL_NEVER + state->depth.func);
if (state->depth.writemask)
glDepthMask(GL_TRUE);
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,083 | static void vrend_hw_emit_framebuffer_state(struct vrend_context *ctx)
{
static const GLenum buffers[8] = {
GL_COLOR_ATTACHMENT0_EXT,
GL_COLOR_ATTACHMENT1_EXT,
GL_COLOR_ATTACHMENT2_EXT,
GL_COLOR_ATTACHMENT3_EXT,
GL_COLOR_ATTACHMENT4_EXT,
GL_COLOR_ATTACHMENT5_EXT,
GL_COLOR_AT... | DoS | 0 | static void vrend_hw_emit_framebuffer_state(struct vrend_context *ctx)
{
static const GLenum buffers[8] = {
GL_COLOR_ATTACHMENT0_EXT,
GL_COLOR_ATTACHMENT1_EXT,
GL_COLOR_ATTACHMENT2_EXT,
GL_COLOR_ATTACHMENT3_EXT,
GL_COLOR_ATTACHMENT4_EXT,
GL_COLOR_ATTACHMENT5_EXT,
GL_COLOR_AT... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,084 | static void vrend_hw_emit_rs(struct vrend_context *ctx)
{
struct pipe_rasterizer_state *state = &ctx->sub->rs_state;
int i;
if (state->depth_clip) {
glDisable(GL_DEPTH_CLAMP);
} else {
glEnable(GL_DEPTH_CLAMP);
}
if (state->point_size_per_vertex) {
glEnable(GL_PROGRAM_POINT_SIZE);
... | DoS | 0 | static void vrend_hw_emit_rs(struct vrend_context *ctx)
{
struct pipe_rasterizer_state *state = &ctx->sub->rs_state;
int i;
if (state->depth_clip) {
glDisable(GL_DEPTH_CLAMP);
} else {
glEnable(GL_DEPTH_CLAMP);
}
if (state->point_size_per_vertex) {
glEnable(GL_PROGRAM_POINT_SIZE);
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,085 | bool vrend_hw_switch_context(struct vrend_context *ctx, bool now)
{
if (ctx == vrend_state.current_ctx && ctx->ctx_switch_pending == false)
return true;
if (ctx->ctx_id != 0 && ctx->in_error) {
return false;
}
ctx->ctx_switch_pending = true;
if (now == true) {
vrend_finish_context_swi... | DoS | 0 | bool vrend_hw_switch_context(struct vrend_context *ctx, bool now)
{
if (ctx == vrend_state.current_ctx && ctx->ctx_switch_pending == false)
return true;
if (ctx->ctx_id != 0 && ctx->in_error) {
return false;
}
ctx->ctx_switch_pending = true;
if (now == true) {
vrend_finish_context_swi... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,086 | static void vrend_init_pstipple_texture(struct vrend_context *ctx)
{
glGenTextures(1, &ctx->pstipple_tex_id);
glBindTexture(GL_TEXTURE_2D, ctx->pstipple_tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, 32, 32, 0, GL_RED, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
... | DoS | 0 | static void vrend_init_pstipple_texture(struct vrend_context *ctx)
{
glGenTextures(1, &ctx->pstipple_tex_id);
glBindTexture(GL_TEXTURE_2D, ctx->pstipple_tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, 32, 32, 0, GL_RED, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,087 | vrend_insert_format(struct vrend_format_table *entry, uint32_t bindings)
{
tex_conv_table[entry->format] = *entry;
tex_conv_table[entry->format].bindings = bindings;
}
| DoS | 0 | vrend_insert_format(struct vrend_format_table *entry, uint32_t bindings)
{
tex_conv_table[entry->format] = *entry;
tex_conv_table[entry->format].bindings = bindings;
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,088 | bool vrend_is_ds_format(enum virgl_formats format)
{
return vrend_format_is_ds(format);
}
| DoS | 0 | bool vrend_is_ds_format(enum virgl_formats format)
{
return vrend_format_is_ds(format);
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,089 | static bool vrend_is_timer_query(GLenum gltype)
{
return gltype == GL_TIMESTAMP ||
gltype == GL_TIME_ELAPSED;
}
| DoS | 0 | static bool vrend_is_timer_query(GLenum gltype)
{
return gltype == GL_TIMESTAMP ||
gltype == GL_TIME_ELAPSED;
}
| @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,090 | void vrend_object_bind_blend(struct vrend_context *ctx,
uint32_t handle)
{
struct pipe_blend_state *state;
if (handle == 0) {
memset(&ctx->sub->blend_state, 0, sizeof(ctx->sub->blend_state));
vrend_blend_enable(ctx, false);
return;
}
state = vrend_object_looku... | DoS | 0 | void vrend_object_bind_blend(struct vrend_context *ctx,
uint32_t handle)
{
struct pipe_blend_state *state;
if (handle == 0) {
memset(&ctx->sub->blend_state, 0, sizeof(ctx->sub->blend_state));
vrend_blend_enable(ctx, false);
return;
}
state = vrend_object_looku... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,091 | void vrend_object_bind_dsa(struct vrend_context *ctx,
uint32_t handle)
{
struct pipe_depth_stencil_alpha_state *state;
if (handle == 0) {
memset(&ctx->sub->dsa_state, 0, sizeof(ctx->sub->dsa_state));
ctx->sub->dsa = NULL;
ctx->sub->stencil_state_dirty = true;
ct... | DoS | 0 | void vrend_object_bind_dsa(struct vrend_context *ctx,
uint32_t handle)
{
struct pipe_depth_stencil_alpha_state *state;
if (handle == 0) {
memset(&ctx->sub->dsa_state, 0, sizeof(ctx->sub->dsa_state));
ctx->sub->dsa = NULL;
ctx->sub->stencil_state_dirty = true;
ct... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,092 | void vrend_object_bind_rasterizer(struct vrend_context *ctx,
uint32_t handle)
{
struct pipe_rasterizer_state *state;
if (handle == 0) {
memset(&ctx->sub->rs_state, 0, sizeof(ctx->sub->rs_state));
return;
}
state = vrend_object_lookup(ctx->sub->object_hash, han... | DoS | 0 | void vrend_object_bind_rasterizer(struct vrend_context *ctx,
uint32_t handle)
{
struct pipe_rasterizer_state *state;
if (handle == 0) {
memset(&ctx->sub->rs_state, 0, sizeof(ctx->sub->rs_state));
return;
}
state = vrend_object_lookup(ctx->sub->object_hash, han... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,093 | static void vrend_patch_blend_state(struct vrend_context *ctx)
{
struct pipe_blend_state new_state = ctx->sub->blend_state;
struct pipe_blend_state *state = &ctx->sub->blend_state;
bool dest_alpha_only = false, dest_has_no_alpha = false;
struct pipe_blend_color blend_color = ctx->sub->blend_color;
int i;... | DoS | 0 | static void vrend_patch_blend_state(struct vrend_context *ctx)
{
struct pipe_blend_state new_state = ctx->sub->blend_state;
struct pipe_blend_state *state = &ctx->sub->blend_state;
bool dest_alpha_only = false, dest_has_no_alpha = false;
struct pipe_blend_color blend_color = ctx->sub->blend_color;
int i;... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,094 | static void vrend_pause_render_condition(struct vrend_context *ctx, bool pause)
{
if (pause) {
if (ctx->sub->cond_render_q_id)
glEndConditionalRenderNV();
} else {
if (ctx->sub->cond_render_q_id)
glBeginConditionalRender(ctx->sub->cond_render_q_id,
c... | DoS | 0 | static void vrend_pause_render_condition(struct vrend_context *ctx, bool pause)
{
if (pause) {
if (ctx->sub->cond_render_q_id)
glEndConditionalRenderNV();
} else {
if (ctx->sub->cond_render_q_id)
glBeginConditionalRender(ctx->sub->cond_render_q_id,
c... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,095 | void vrend_renderer_attach_res_ctx(int ctx_id, int resource_id)
{
struct vrend_context *ctx = vrend_lookup_renderer_ctx(ctx_id);
struct vrend_resource *res;
if (!ctx)
return;
res = vrend_resource_lookup(resource_id, 0);
if (!res)
return;
vrend_object_insert_nofree(ctx->res_hash, res, si... | DoS | 0 | void vrend_renderer_attach_res_ctx(int ctx_id, int resource_id)
{
struct vrend_context *ctx = vrend_lookup_renderer_ctx(ctx_id);
struct vrend_resource *res;
if (!ctx)
return;
res = vrend_resource_lookup(resource_id, 0);
if (!res)
return;
vrend_object_insert_nofree(ctx->res_hash, res, si... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,096 | void vrend_renderer_blit(struct vrend_context *ctx,
uint32_t dst_handle, uint32_t src_handle,
const struct pipe_blit_info *info)
{
struct vrend_resource *src_res, *dst_res;
src_res = vrend_renderer_ctx_res_lookup(ctx, src_handle);
dst_res = vrend_renderer_ctx_r... | DoS | 0 | void vrend_renderer_blit(struct vrend_context *ctx,
uint32_t dst_handle, uint32_t src_handle,
const struct pipe_blit_info *info)
{
struct vrend_resource *src_res, *dst_res;
src_res = vrend_renderer_ctx_res_lookup(ctx, src_handle);
dst_res = vrend_renderer_ctx_r... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,097 | static void vrend_renderer_blit_int(struct vrend_context *ctx,
struct vrend_resource *src_res,
struct vrend_resource *dst_res,
const struct pipe_blit_info *info)
{
GLbitfield glmask = 0;
int src_y1, src_y2,... | DoS | 0 | static void vrend_renderer_blit_int(struct vrend_context *ctx,
struct vrend_resource *src_res,
struct vrend_resource *dst_res,
const struct pipe_blit_info *info)
{
GLbitfield glmask = 0;
int src_y1, src_y2,... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,098 | void vrend_renderer_check_queries(void)
{
struct vrend_query *query, *stor;
if (!vrend_state.inited)
return;
LIST_FOR_EACH_ENTRY_SAFE(query, stor, &vrend_state.waiting_query_list, waiting_queries) {
vrend_hw_switch_context(vrend_lookup_renderer_ctx(query->ctx_id), true);
if (vrend_check_que... | DoS | 0 | void vrend_renderer_check_queries(void)
{
struct vrend_query *query, *stor;
if (!vrend_state.inited)
return;
LIST_FOR_EACH_ENTRY_SAFE(query, stor, &vrend_state.waiting_query_list, waiting_queries) {
vrend_hw_switch_context(vrend_lookup_renderer_ctx(query->ctx_id), true);
if (vrend_check_que... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
7,099 | void vrend_renderer_create_sub_ctx(struct vrend_context *ctx, int sub_ctx_id)
{
struct vrend_sub_context *sub;
struct virgl_gl_ctx_param ctx_params;
LIST_FOR_EACH_ENTRY(sub, &ctx->sub_ctxs, head) {
if (sub->sub_ctx_id == sub_ctx_id) {
return;
}
}
sub = CALLOC_STRUCT(vrend_sub_conte... | DoS | 0 | void vrend_renderer_create_sub_ctx(struct vrend_context *ctx, int sub_ctx_id)
{
struct vrend_sub_context *sub;
struct virgl_gl_ctx_param ctx_params;
LIST_FOR_EACH_ENTRY(sub, &ctx->sub_ctxs, head) {
if (sub->sub_ctx_id == sub_ctx_id) {
return;
}
}
sub = CALLOC_STRUCT(vrend_sub_conte... | @@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_ar... | CWE-772 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.