Hello,

Attached patch fixes segmentation fault in libavformat/a64.c a64_write_header() when output stream's codec is not open, so avctx->codec is NULL (in "stream_copy" use case for example). Correct access to codec id is use of "avctx->codec_id" instead of "avctx->codec->id".

Regards,
    Andrey Myznikov

>From e792c3db82b35f7f6d4cd9000e3be297b02df88d Mon Sep 17 00:00:00 2001
From: Andrey Myznikov <andrey.myzni...@gmail.com>
Date: Mon, 18 Aug 2014 20:03:31 +0300
Subject: [PATCH] Avoid segfault in a64_write_header() when stream codec is not
 open

---
 libavformat/a64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/a64.c b/libavformat/a64.c
index 03679b2..a7f93a2 100644
--- a/libavformat/a64.c
+++ b/libavformat/a64.c
@@ -40,7 +40,7 @@ static int a64_write_header(AVFormatContext *s)
         return AVERROR_INVALIDDATA;
     }
 
-    switch (avctx->codec->id) {
+    switch (avctx->codec_id) {
     case AV_CODEC_ID_A64_MULTI:
         header[2] = 0x00;
         header[3] = AV_RB32(avctx->extradata+0);
-- 
2.0.4

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to