render: don't free blur_kerns_cache when it's not used
blur_kernel_count could be none zero when user set a blur kernel but didn't enable blur. In that case deinit_render will try to free elements of blur_kerns_cache, causing a segfault because blur_kerns_cache is never allocated. Fixes #209 Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
ea6f355a6b
commit
1f80c8dc16
|
@ -1216,10 +1216,12 @@ void deinit_render(session_t *ps) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (ps->o.blur_method != BLUR_METHOD_NONE) {
|
||||||
for (int i = 0; i < ps->o.blur_kernel_count; i++) {
|
for (int i = 0; i < ps->o.blur_kernel_count; i++) {
|
||||||
free(ps->blur_kerns_cache[i]);
|
free(ps->blur_kerns_cache[i]);
|
||||||
}
|
}
|
||||||
free(ps->blur_kerns_cache);
|
free(ps->blur_kerns_cache);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// vim: set ts=8 sw=8 noet :
|
// vim: set ts=8 sw=8 noet :
|
||||||
|
|
Loading…
Reference in New Issue