aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2013-08-18 17:40:51 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-10-28 14:16:37 +0100
commit5971631d84546466cf6bde65c71920239295e4d3 (patch)
treef00c91a4fa128b856208a13fe3e1b76a36730f8d
parent4a11d773f9f7e9c21416264c30d4a260d1dc49a6 (diff)
downloadffmpeg-5971631d84546466cf6bde65c71920239295e4d3.tar.gz
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@libav.org Signed-off-by: Jan Gerber <j@v2v.cc> Signed-off-by: Luca Barbato <lu_zero@gentoo.org> (cherry picked from commit 9a27acae9e6b7d0bf74c5b878af9c42495a546f3) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Conflicts: libavformat/oggdec.c
-rw-r--r--libavformat/oggdec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 2a1c0a5f6f..8d59470549 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -376,7 +376,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);