Commit: a64cb4185e2a6695d7fe12637fd9b624714fe75e
Author: Antony Riakiotakis
Date: Tue May 26 13:45:45 2015 +0200
Branches: master
https://developer.blender.org/rBa64cb4185e2a6695d7fe12637fd9b624714fe75e
Trying to pack image with invalid path crashes
===================================================================
M source/blender/blenkernel/intern/image.c
===================================================================
diff --git a/source/blender/blenkernel/intern/image.c
b/source/blender/blenkernel/intern/image.c
index 7b6e749..f22a519 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1017,7 +1017,12 @@ void BKE_image_packfiles(ReportList *reports, Image
*ima, const char *basepath)
ImagePackedFile *imapf = MEM_mallocN(sizeof(ImagePackedFile),
"Image packed file");
BLI_addtail(&ima->packedfiles, imapf);
imapf->packedfile = newPackedFile(reports, ima->name, basepath);
- BLI_strncpy(imapf->filepath, ima->name,
sizeof(imapf->filepath));
+ if (imapf->packedfile) {
+ BLI_strncpy(imapf->filepath, ima->name,
sizeof(imapf->filepath));
+ }
+ else {
+ BLI_freelinkN(&ima->packedfiles, imapf);
+ }
}
else {
ImageView *iv;
@@ -1026,7 +1031,12 @@ void BKE_image_packfiles(ReportList *reports, Image
*ima, const char *basepath)
BLI_addtail(&ima->packedfiles, imapf);
imapf->packedfile = newPackedFile(reports,
iv->filepath, basepath);
- BLI_strncpy(imapf->filepath, iv->filepath,
sizeof(imapf->filepath));
+ if (imapf->packedfile) {
+ BLI_strncpy(imapf->filepath, iv->filepath,
sizeof(imapf->filepath));
+ }
+ else {
+ BLI_freelinkN(&ima->packedfiles, imapf);
+ }
}
}
}
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs