diff options
author | Andrea Weikert <elubie@gmx.net> | 2007-09-02 21:41:25 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2007-09-02 21:41:25 +0400 |
commit | 600c4c7c19f83aa4725cec9ec1526741f0a04c58 (patch) | |
tree | d85c9f885ea757c69af5286e1ba9c4cc97240b9b /source/blender/imbuf | |
parent | 356ab943736e8a2434a8ff5845873482597ba5e2 (diff) |
== imagebrowser ==
fix for missing null pointer check in IMB_thumb_create.
found by Diego Borghetti (bdiego) - thanks!
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/thumbs.c | 14 |
1 files changed, 8 insertions, 6 deletions
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); |