== imagebrowser ==

fix for missing null pointer check in IMB_thumb_create.
found by Diego Borghetti (bdiego) - thanks!
This commit is contained in:
Andrea Weikert
2007-09-02 17:41:25 +00:00
parent 356ab94373
commit 600c4c7c19

View File

@@ -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);