Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-05-02 14:22:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-02 14:22:49 +0400
commit02fbaede8f33b4acc3421e6d641dfa9359a264da (patch)
tree090e675178c3797ecbd0d7cdfbaf20a268f3e9a4 /source/blender/imbuf/intern
parent1357443e48881617462463bf8e9037e4fa487d79 (diff)
workaround [#27203] Crashes with some high-res image thumbnail generation
skip generating thumbs for images over 100mb. also pass string lengths as size_t rather then int for path_util.c functions.
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r--source/blender/imbuf/intern/thumbs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 3e17665fa39..1d91f34f4fa 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -275,6 +275,15 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im
return NULL; /* unknown size */
}
+ /* exception, skip images over 100mb */
+ if(source == THB_SOURCE_IMAGE) {
+ const size_t size= BLI_filepathsize(path);
+ if(size != -1 && size > THUMB_SIZE_MAX) {
+ // printf("file too big: %d, skipping %s\n", (int)size, path);
+ return NULL;
+ }
+ }
+
uri_from_filename(path, uri);
thumbname_from_uri(uri, thumb, sizeof(thumb));
if (get_thumb_dir(tdir, size)) {