Skip to content

Commit f66be72

Browse files
committed
vo_pp/text: avoid crashes (abort in magick) if not init
1 parent fe5b507 commit f66be72

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/vo_postprocess/text.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,15 @@ static void text_done(void *state)
468468

469469
vf_free(s->in);
470470

471-
DestroyMagickWand(s->wand_bg);
472-
DestroyMagickWand(s->wand_text);
473-
DestroyDrawingWand(s->dw);
471+
if (s->wand_bg) {
472+
DestroyMagickWand(s->wand_bg);
473+
}
474+
if (s->wand_text) {
475+
DestroyMagickWand(s->wand_text);
476+
}
477+
if (s->dw) {
478+
DestroyDrawingWand(s->dw);
479+
}
474480

475481
free(s->data);
476482
free(s->text);

0 commit comments

Comments
 (0)