From 600c4c7c19f83aa4725cec9ec1526741f0a04c58 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Sun, 2 Sep 2007 17:41:25 +0000 Subject: == imagebrowser == fix for missing null pointer check in IMB_thumb_create. found by Diego Borghetti (bdiego) - thanks! --- source/blender/imbuf/intern/thumbs.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index 6976aff6b39..4bfde95d2bb 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -281,12 +281,14 @@ ImBuf* IMB_thumb_create(const char* dir, const char* file, ThumbSize size, Thumb if (THB_SOURCE_IMAGE == source) { BLI_getwdN(wdir); chdir(dir); - img = IMB_loadiffname(file, IB_rect); - stat(file, &info); - sprintf(mtime, "%ld", info.st_mtime); - sprintf(cwidth, "%d", img->x); - sprintf(cheight, "%d", img->y); - chdir(wdir); + img = IMB_loadiffname(file, IB_rect); + if (img != NULL) { + stat(file, &info); + sprintf(mtime, "%ld", info.st_mtime); + sprintf(cwidth, "%d", img->x); + sprintf(cheight, "%d", img->y); + chdir(wdir); + } } else if (THB_SOURCE_MOVIE == source) { struct anim * anim = NULL; BLI_getwdN(wdir); -- cgit v1.2.3