提交 c9e225d7 编写于 作者: J jp9000

Prevent loading image files with null/empty paths

上级 6d89dde0
......@@ -59,6 +59,9 @@ static bool ffmpeg_image_init(struct ffmpeg_image *info, const char *file)
{
int ret;
if (!file || !*file)
return false;
memset(info, 0, sizeof(struct ffmpeg_image));
info->file = file;
info->stream_idx = -1;
......
......@@ -29,7 +29,7 @@ static void image_source_update(void *data, obs_data_t settings)
context->tex = NULL;
}
if (file) {
if (file && *file) {
context->tex = gs_create_texture_from_file(file);
if (context->tex) {
context->cx = texture_getwidth(context->tex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册