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:
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index c520714b076..1d209dec935 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1612,7 +1612,7 @@ typedef struct StampDataCustomField {
struct StampDataCustomField *next, *prev;
/* TODO(sergey): Think of better size here, maybe dynamically allocated even. */
char key[512];
- char value[512];
+ char *value;
/* TODO(sergey): Support non-string values. */
} StampDataCustomField;
@@ -2177,12 +2177,9 @@ void BKE_stamp_info_callback(void *data, struct StampData *stamp_data, StampCall
CALL(rendertime, "RenderTime");
CALL(memory, "Memory");
- for (StampDataCustomField *custom_field = stamp_data->custom_fields.first;
- custom_field != NULL;
- custom_field = custom_field->next)
- {
+ LISTBASE_FOREACH(StampDataCustomField *, custom_field, &stamp_data->custom_fields) {
if (noskip || custom_field->value[0]) {
- callback(data, custom_field->key, custom_field->value, sizeof(custom_field->value));
+ callback(data, custom_field->key, custom_field->value, strlen(custom_field->value) + 1);
}
}
@@ -2199,7 +2196,7 @@ void BKE_render_result_stamp_data(RenderResult *rr, const char *key, const char
StampDataCustomField *field = MEM_mallocN(sizeof(StampDataCustomField),
"StampData Custom Field");
STRNCPY(field->key, key);
- STRNCPY(field->value, value);
+ field->value = BLI_strdup(value);
BLI_addtail(&stamp_data->custom_fields, field);
}
@@ -2208,6 +2205,9 @@ void BKE_stamp_data_free(struct StampData *stamp_data)
if (stamp_data == NULL) {
return;
}
+ LISTBASE_FOREACH(StampDataCustomField *, custom_field, &stamp_data->custom_fields) {
+ MEM_freeN(custom_field->value);
+ }
BLI_freelistN(&stamp_data->custom_fields);
MEM_freeN(stamp_data);
}
@@ -2898,7 +2898,7 @@ static RenderPass *image_render_pass_get(RenderLayer *rl, const int pass, const
}
/* if layer or pass changes, we need an index for the imbufs list */
-/* note it is called for rendered results, but it doesnt use the index! */
+/* note it is called for rendered results, but it doesn't use the index! */
/* and because rendered results use fake layer/passes, don't correct for wrong indices here */
RenderPass *BKE_image_multilayer_index(RenderResult *rr, ImageUser *iuser)
{
@@ -2950,7 +2950,7 @@ void BKE_image_multiview_index(Image *ima, ImageUser *iuser)
}
/* if layer or pass changes, we need an index for the imbufs list */
-/* note it is called for rendered results, but it doesnt use the index! */
+/* note it is called for rendered results, but it doesn't use the index! */
/* and because rendered results use fake layer/passes, don't correct for wrong indices here */
bool BKE_image_is_multilayer(Image *ima)
{
@@ -3784,7 +3784,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **r_loc
*
* This is mainly to make it so color management treats byte buffer
* from render result with Save Buffers enabled as final display buffer
- * and doesnt' apply any color management on it.
+ * and doesn't apply any color management on it.
*
* For other cases we need to be sure it stays to default byte buffer space.
*/