gl_common: zero initialize new image data in gl_image_decouple
Previously some fiedls of gl_texture allocated in gl_image_decouple are not initialized. This commit replaces cmalloc with ccalloc to make sure the allocated gl_texture is zero initialized. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
5d7ff7101e
commit
0eca07d400
|
@ -1302,7 +1302,7 @@ static inline void gl_image_decouple(backend_t *base, struct gl_image *img) {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct gl_data *gl = (void *)base;
|
struct gl_data *gl = (void *)base;
|
||||||
auto new_tex = cmalloc(struct gl_texture);
|
auto new_tex = ccalloc(1, struct gl_texture);
|
||||||
|
|
||||||
glGenTextures(1, &new_tex->texture);
|
glGenTextures(1, &new_tex->texture);
|
||||||
glBindTexture(GL_TEXTURE_2D, new_tex->texture);
|
glBindTexture(GL_TEXTURE_2D, new_tex->texture);
|
||||||
|
|
Loading…
Reference in New Issue