[FFmpeg-cvslog] ogg: Fix potential infinite discard loop

Reimar Döffinger git at videolan.org
Tue Aug 27 19:23:51 CEST 2013


ffmpeg | branch: release/1.1 | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Sun Aug 18 17:40:51 2013 +0200| [cbc6ded5b780195edc93d37f8b9e8eb6e00e8f0a] | committer: Luca Barbato

ogg: Fix potential infinite discard loop

Seeking in certain broken files would cause ogg_read_timestamp
to fail because ogg_packet would go into a state where all packets
of stream 1 would be discarded until the end of the stream.

Bug-Id: 553
CC: libav-stable at libav.org

Signed-off-by: Jan Gerber <j at v2v.cc>
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
(cherry picked from commit 9a27acae9e6b7d0bf74c5b878af9c42495a546f3)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

 libavformat/oggdec.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index d8f89b8..03ec50e 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -384,7 +384,11 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
 
         if (!complete && os->segp == os->nsegs) {
             ogg->curidx    = -1;
-            os->incomplete = 1;
+            // Do not set incomplete for empty packets.
+            // Together with the code in ogg_read_page
+            // that discards all continuation of empty packets
+            // we would get an infinite loop.
+            os->incomplete = !!os->psize;
         }
     } while (!complete);
 



More information about the ffmpeg-cvslog mailing list