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>2015-06-05 04:46:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-06-05 04:46:01 +0300
commitaca40295e8ac868b6e3aec40bbcd388177508c1f (patch)
tree5f9f329021231b8434581b9ea786dec431ecfd96 /source/blender/makesdna/intern
parentb2e5c017a1a93ec9b6f001bae385c7cc9b756cca (diff)
Check ftell return values
Diffstat (limited to 'source/blender/makesdna/intern')
-rw-r--r--source/blender/makesdna/intern/makesdna.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 7f3e9b7c196..a7ff4244d5f 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -539,6 +539,11 @@ static void *read_file_data(char *filename, int *r_len)
*r_len = ftell(fp);
fseek(fp, 0L, SEEK_SET);
+ if (*r_len == -1) {
+ fclose(fp);
+ return NULL;
+ }
+
data = MEM_mallocN(*r_len, "read_file_data");
if (!data) {
*r_len = -1;