segment: fix NULL pointer dereference in seg_write_header()
authorXi Wang <xi.wang@gmail.com>
Wed, 14 Nov 2012 07:52:32 +0000 (02:52 -0500)
committerMartin Storsjö <martin@martin.st>
Wed, 14 Nov 2012 10:33:27 +0000 (12:33 +0200)
Since the pointer `oc' is NULL, oc->oformat->name will cause a null
pointer dereference.  This patch changes it to seg->oformat->name.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/segment.c

index fd52835..8afb41f 100644 (file)
@@ -210,7 +210,7 @@ static int seg_write_header(AVFormatContext *s)
     }
     if (seg->oformat->flags & AVFMT_NOFILE) {
         av_log(s, AV_LOG_ERROR, "format %s not supported.\n",
-               oc->oformat->name);
+               seg->oformat->name);
         ret = AVERROR(EINVAL);
         goto fail;
     }