From fc257ff83d292482e217604c3eddb7bf5e8aca10 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 10 Apr 2025 12:25:26 +0200 Subject: [PATCH] vo_pp/text: fix CID 480256 --- src/vo_postprocess/text.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vo_postprocess/text.c b/src/vo_postprocess/text.c index e313288d0..80c0ebd9a 100644 --- a/src/vo_postprocess/text.c +++ b/src/vo_postprocess/text.c @@ -100,6 +100,8 @@ struct state_text { MagickWand *wand_text; }; +static void text_done(void *state); + static bool text_get_property(void *state, int property, void *val, size_t *len) { UNUSED(state); @@ -172,13 +174,13 @@ static void * text_init(const char *config) { if(!s->text || strlen(s->text) == 0){ log_msg(LOG_LEVEL_ERROR, "[text] Text can not be empty!\n"); - free(s); + text_done(s); return NULL; } if (s->req_h < -1) { log_msg(LOG_LEVEL_ERROR, "[text] Text height cannot be negative!\n"); - free(s); + text_done(s); return NULL; }