avfilter/vf_fps: make sure the fifo is not empty before using it
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 2 Sep 2013 02:32:23 +0000 (04:32 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 5 Sep 2013 01:01:10 +0000 (03:01 +0200)
Fixes Ticket2905

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cdd5df8189ff1537f7abe8defe971f80602cc2d2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/vf_fps.c

index c13b1bd..3d355cf 100644 (file)
@@ -201,7 +201,7 @@ static int end_frame(AVFilterLink *inlink)
     }
 
     /* now wait for the next timestamp */
-    if (buf->pts == AV_NOPTS_VALUE) {
+    if (buf->pts == AV_NOPTS_VALUE || av_fifo_size(s->fifo) <= 0) {
         return write_to_fifo(s->fifo, buf);
     }