From f313aaa5a6e9359b5bc3d58623ff912c99044cca Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 28 Jun 2014 18:52:13 -0700 Subject: [PATCH] Fix bug magickcore file loading freeze This seemed to happen if the 'file' variable was NULL. For some reason, magickcore would just totally freeze. --- libobs/graphics/graphics-magick.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libobs/graphics/graphics-magick.c b/libobs/graphics/graphics-magick.c index e6d80f2e6..0e22e5a8e 100644 --- a/libobs/graphics/graphics-magick.c +++ b/libobs/graphics/graphics-magick.c @@ -14,11 +14,17 @@ void gs_free_image_deps() texture_t gs_create_texture_from_file(const char *file) { - texture_t tex = NULL; - ImageInfo *info = CloneImageInfo(NULL); - ExceptionInfo *exception = AcquireExceptionInfo(); + texture_t tex = NULL; + ImageInfo *info; + ExceptionInfo *exception; Image *image; + if (!file || !*file) + return NULL; + + info = CloneImageInfo(NULL); + exception = AcquireExceptionInfo(); + strcpy(info->filename, file); image = ReadImage(info, exception); if (image) {