From: Stefano Sabatini Date: Tue, 19 Mar 2013 16:57:50 +0000 (+0100) Subject: ffprobe: set writer context to 0 after allocation X-Git-Tag: android-x86-4.4-r1~4938 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e292d75113fdcb28dcd76321771ec139393af35e;p=android-x86%2Fexternal-ffmpeg.git 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. --- diff --git a/ffprobe.c b/ffprobe.c index ef9bef44c7..4d2d3e1e47 100644 --- a/ffprobe.c +++ b/ffprobe.c @@ -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; }