[FFmpeg-cvslog] lavf/concatdec: do not access packet if av_read_frame returned error

Marton Balint git at videolan.org
Sun Jan 10 14:24:26 CET 2016


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sat Nov 28 13:05:30 2015 +0100| [fdb2d4b1084c92aa9bb1d2f948abdb86a361f219] | committer: Marton Balint

lavf/concatdec: do not access packet if av_read_frame returned error

Reviewed-by: Nicolas George <george at nsup.org>
Signed-off-by: Marton Balint <cus at passwd.hu>

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

 libavformat/concatdec.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index d21805f..d226e15 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -555,9 +555,7 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
 
     while (1) {
         ret = av_read_frame(cat->avf, pkt);
-        if (ret == AVERROR_EOF || packet_after_outpoint(cat, pkt)) {
-            if (ret == 0)
-                av_packet_unref(pkt);
+        if (ret == AVERROR_EOF) {
             if ((ret = open_next_file(avf)) < 0)
                 return ret;
             continue;
@@ -568,6 +566,12 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
             av_packet_unref(pkt);
             return ret;
         }
+        if (packet_after_outpoint(cat, pkt)) {
+            av_packet_unref(pkt);
+            if ((ret = open_next_file(avf)) < 0)
+                return ret;
+            continue;
+        }
         cs = &cat->cur_file->streams[pkt->stream_index];
         if (cs->out_stream_index < 0) {
             av_packet_unref(pkt);



More information about the ffmpeg-cvslog mailing list