Skip to content

Commit fc257ff

Browse files
committed
vo_pp/text: fix CID 480256
1 parent eea61b2 commit fc257ff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/vo_postprocess/text.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ struct state_text {
100100
MagickWand *wand_text;
101101
};
102102

103+
static void text_done(void *state);
104+
103105
static bool text_get_property(void *state, int property, void *val, size_t *len)
104106
{
105107
UNUSED(state);
@@ -172,13 +174,13 @@ static void * text_init(const char *config) {
172174

173175
if(!s->text || strlen(s->text) == 0){
174176
log_msg(LOG_LEVEL_ERROR, "[text] Text can not be empty!\n");
175-
free(s);
177+
text_done(s);
176178
return NULL;
177179
}
178180

179181
if (s->req_h < -1) {
180182
log_msg(LOG_LEVEL_ERROR, "[text] Text height cannot be negative!\n");
181-
free(s);
183+
text_done(s);
182184
return NULL;
183185
}
184186

0 commit comments

Comments
 (0)