[FFmpeg-cvslog] ffprobe: fix NULL pointer dereference in writer_close()

Stefano Sabatini git at videolan.org
Fri Jan 6 10:45:26 CET 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Thu Jan  5 11:00:12 2012 +0100| [49c207b8205bf018bd3afff9b26222178f111bbc] | committer: Stefano Sabatini

ffprobe: fix NULL pointer dereference in writer_close()

Fix crash.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49c207b8205bf018bd3afff9b26222178f111bbc
---

 ffprobe.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ffprobe.c b/ffprobe.c
index ee3c899..77c343a 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -178,9 +178,11 @@ static const AVClass writer_class = {
 
 static void writer_close(WriterContext **wctx)
 {
-    if (*wctx && (*wctx)->writer->uninit)
-        (*wctx)->writer->uninit(*wctx);
+    if (!*wctx)
+        return;
 
+    if ((*wctx)->writer->uninit)
+        (*wctx)->writer->uninit(*wctx);
     av_freep(&((*wctx)->priv));
     av_freep(wctx);
 }



More information about the ffmpeg-cvslog mailing list