Hi,

the bit format muxer currently segfaults, when it is passed a packet of size 0.
This can be triggered e.g. with:
ffmpeg -y -f lavfi -i sine=duration=0.1 -c:a flac -f bit /dev/null

Attached patch fixes this.

Best regards,
Andreas
>From 6990ac1deb197613bfaffca1d721e94042c68b04 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
Date: Thu, 26 Feb 2015 20:27:30 +0100
Subject: [PATCH] avformat/bit: return early from write_packet if pkt->size is
 0

This avoids a null pointer dereference of pkt->data.

Signed-off-by: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
---
 libavformat/bit.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/bit.c b/libavformat/bit.c
index 7b807b9..9e9feef 100644
--- a/libavformat/bit.c
+++ b/libavformat/bit.c
@@ -133,6 +133,9 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
     GetBitContext gb;
     int i;
 
+    if (!pkt->size)
+        return 0;
+
     avio_wl16(pb, SYNC_WORD);
     avio_wl16(pb, 8 * 10);
 
-- 
2.1.4

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

Reply via email to