Skip to content

Commit

Permalink
libobs: Use bmalloc/bfree for caption data
Browse files Browse the repository at this point in the history
  • Loading branch information
JoHn BoWeRs authored and Lain-B committed Apr 27, 2024
1 parent 5c8be1d commit 3ab71a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libobs/obs-output.c
Expand Up @@ -1522,7 +1522,7 @@ static size_t extract_itut_t35_buffer_from_sei(sei_t *sei, uint8_t **data_out)
sei_message_t *msg = sei_message_head(sei);
int payload_size = (int)sei_message_size(msg);
uint8_t *payload_data = sei_message_data(msg);
*data_out = malloc(payload_size);
*data_out = bmalloc(payload_size);
memcpy(*data_out, payload_data, payload_size);
return payload_size;
}
Expand Down Expand Up @@ -1657,7 +1657,7 @@ static bool add_caption(struct obs_output *output, struct encoder_packet *out)

if (avc || hevc || av1) {
if (avc || hevc) {
data = malloc(sei_render_size(&sei));
data = bmalloc(sei_render_size(&sei));
size = sei_render(&sei, data);
}
/* In each of these specs there is an identical structure that
Expand Down Expand Up @@ -1711,7 +1711,7 @@ static bool add_caption(struct obs_output *output, struct encoder_packet *out)
}
}
if (data) {
free(data);
bfree(data);
}
obs_encoder_packet_release(out);

Expand Down

0 comments on commit 3ab71a9

Please sign in to comment.