Skip to content
Snippets Groups Projects
Commit e292d751 authored by Stefano Sabatini's avatar Stefano Sabatini
Browse files

ffprobe: set writer context to 0 after allocation

Avoid access to uninitialized values, which may result in a crash.

This happens for example in case of option parsing failure, since in that
case the internal AVBprint buffers are not initialized.
parent 1c3b4281
No related branches found
No related tags found
No related merge requests found
......@@ -300,7 +300,7 @@ static int writer_open(WriterContext **wctx, const Writer *writer, const char *a
{
int i, ret = 0;
if (!(*wctx = av_malloc(sizeof(WriterContext)))) {
if (!(*wctx = av_mallocz(sizeof(WriterContext)))) {
ret = AVERROR(ENOMEM);
goto fail;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment