[FFmpeg-cvslog] avconv: fix segfault at EOF with delayed pictures

Janne Grunau git at videolan.org
Thu Nov 24 03:38:34 CET 2011


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Thu Nov 24 00:18:33 2011 +0100| [aa38cff2c6fdc1c0a7245f8a2aef5f6d4d2881d1] | committer: Janne Grunau

avconv: fix segfault at EOF with delayed pictures

At EOF it makes no sense to modify avpkt.{data,size} in output_packet
since no data is consumed. Frame threading with more than 1 threads
hits the segfault.

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

 avconv.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/avconv.c b/avconv.c
index be870a5..6f64bc8 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1892,8 +1892,11 @@ static int output_packet(InputStream *ist,
 
         if (ret < 0)
             return ret;
-        avpkt.data += ret;
-        avpkt.size -= ret;
+        // touch data and size only if not EOF
+        if (pkt) {
+            avpkt.data += ret;
+            avpkt.size -= ret;
+        }
         if (!got_output) {
             continue;
         }



More information about the ffmpeg-cvslog mailing list