Fix NULL pointer dereference in glx_init_blur

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-01-31 22:40:17 +00:00
parent a0739b7d86
commit 543bbe6a39
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 5 additions and 1 deletions

View File

@ -563,12 +563,16 @@ glx_init_blur(session_t *ps) {
"texture2DRect": "texture2D");
const char *shader_add = FRAG_SHADER_BLUR_ADD;
char *extension = NULL;
if (use_texture_rect)
if (use_texture_rect) {
mstrextend(&extension, "#extension GL_ARB_texture_rectangle : require\n");
}
if (ps->o.glx_use_gpushader4) {
mstrextend(&extension, "#extension GL_EXT_gpu_shader4 : require\n");
shader_add = FRAG_SHADER_BLUR_ADD_GPUSHADER4;
}
if (!extension) {
extension = strdup("");
}
for (int i = 0; i < MAX_BLUR_PASS && ps->o.blur_kerns[i]; ++i) {
xcb_render_fixed_t *kern = ps->o.blur_kerns[i];