1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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.
This commit is contained in:
Stefano Sabatini 2013-03-19 17:57:50 +01:00
parent 1c3b428114
commit e292d75113

View File

@ -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;
}