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:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-05-16 16:34:43 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-05-16 16:36:29 +0300
commit26b232318930739a73d88afc9aaca7992301f03a (patch)
tree7850d9aba71773670b19a25fd277ef61e1cedb9d /source/blender/imbuf/intern/metadata.c
parent8be9d68dd42d6831675356bfa0e1bf9274680df3 (diff)
Fix memory leak when saving OpenEXR files
It is not a good idea to: 1. Duplicate metadata to self 2. Ignore the fact that something might have had metadata already. Also moved metadata copy to a preparation function, so it is never lost.
Diffstat (limited to 'source/blender/imbuf/intern/metadata.c')
-rw-r--r--source/blender/imbuf/intern/metadata.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/metadata.c b/source/blender/imbuf/intern/metadata.c
index 134bbe88f15..d48aec0ba4c 100644
--- a/source/blender/imbuf/intern/metadata.c
+++ b/source/blender/imbuf/intern/metadata.c
@@ -81,7 +81,9 @@ bool IMB_metadata_get_field(struct ImBuf *img, const char *key, char *field, con
void IMB_metadata_copy(struct ImBuf *dimb, struct ImBuf *simb)
{
+ BLI_assert(dimb != simb);
if (simb->metadata) {
+ IDP_FreeProperty(dimb->metadata);
dimb->metadata = IDP_CopyProperty(simb->metadata);
}
}