Skip to content

Commit

Permalink
fix serializing mlt_color
Browse files Browse the repository at this point in the history
Transparent (0, 0, 0, 0) was serializing as "#0", which would then
deserialize to opaque black because it did not have enough chars to
include an alpha component.
  • Loading branch information
ddennedy committed Aug 30, 2023
1 parent 52c5bde commit 21a5b68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/framework/mlt_property.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ char *mlt_property_get_string_tf(mlt_property self, mlt_time_format time_format)
self->prop_string = malloc(10);
uint32_t int_value = ((self->prop_int & 0xff) << 24)
| ((self->prop_int >> 8) & 0xffffff);
sprintf(self->prop_string, "#%x", int_value);
sprintf(self->prop_string, "#%08x", int_value);
} else if (self->types & mlt_prop_double) {
self->types |= mlt_prop_string;
self->prop_string = malloc(32);
Expand Down Expand Up @@ -802,7 +802,7 @@ char *mlt_property_get_string_l_tf(mlt_property self,
self->prop_string = malloc(10);
uint32_t int_value = ((self->prop_int & 0xff) << 24)
| ((self->prop_int >> 8) & 0xffffff);
sprintf(self->prop_string, "#%x", int_value);
sprintf(self->prop_string, "#%08x", int_value);
} else if (self->types & mlt_prop_double) {
self->types |= mlt_prop_string;
self->prop_string = malloc(32);
Expand Down

0 comments on commit 21a5b68

Please sign in to comment.