[Bf-blender-cvs] [88767a1] master: IMB_thumbs: add missing error check

Campbell Barton noreply at git.blender.org
Sat Oct 17 08:12:15 CEST 2015


Commit: 88767a193980ff10ac4c5c4241d7c089823294a9
Author: Campbell Barton
Date:   Sat Oct 17 16:14:36 2015 +1100
Branches: master
https://developer.blender.org/rB88767a193980ff10ac4c5c4241d7c089823294a9

IMB_thumbs: add missing error check

===================================================================

M	source/blender/imbuf/intern/thumbs.c

===================================================================

diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 4e1b5c6..95d061b 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -217,7 +217,7 @@ static bool thumbhash_from_path(const char *UNUSED(path), ThumbSource source, ch
 	}
 }
 
-static int uri_from_filename(const char *path, char *uri)
+static bool uri_from_filename(const char *path, char *uri)
 {
 	char orig_uri[URI_MAX];
 	const char *dirstart = path;
@@ -482,7 +482,9 @@ ImBuf *IMB_thumb_create(const char *path, ThumbSize size, ThumbSource source, Im
 	char uri[URI_MAX] = "";
 	char thumb_name[40];
 
-	uri_from_filename(path, uri);
+	if (!uri_from_filename(path, uri)) {
+		return NULL;
+	}
 	thumbname_from_uri(uri, thumb_name, sizeof(thumb_name));
 
 	return thumb_create_ex(path, uri, thumb_name, false, THUMB_DEFAULT_HASH, NULL, NULL, size, source, img);




More information about the Bf-blender-cvs mailing list