Skip to content

Commit

Permalink
ffprobe: set writer context to 0 after allocation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
saste committed Mar 19, 2013
1 parent 1c3b428 commit e292d75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ffprobe.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit e292d75

Please sign in to comment.