History

fftools/textformat/avtextformat: Fix segfault upon allocation error

Andreas Rheinhardt committed 1 year ago

Commit 7ee76321 parent b9450581 file · +6 −4Browse files

Unified · Split

fftools/textformat/avtextformat.c+6−4
@@ -590,10 +590,12 @@ int avtextwriter_context_close(AVTextWriterContext **pwctx) · 589 unmodified lines
590590 if (!wctx)
591591 return EINVAL;
592592
593− if (wctx->writer->uninit)
594− wctx->writer->uninit(wctx);
595− if (wctx->writer->priv_class)
596− av_opt_free(wctx->priv);
593+ if (wctx->writer) {
594+ if (wctx->writer->uninit)
595+ wctx->writer->uninit(wctx);
596+ if (wctx->writer->priv_class)
597+ av_opt_free(wctx->priv);
598+ }
597599 av_freep(&wctx->priv);
598600 av_freep(pwctx);
599601 return ret;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t