[FFmpeg-cvslog] avformat/oggparsevorbis: dont use invalid granules

Michael Niedermayer git at videolan.org
Thu Mar 6 10:04:58 CET 2014


ffmpeg | branch: release/2.1 | Michael Niedermayer <michaelni at gmx.at> | Wed Mar  5 17:07:28 2014 +0100| [d87ac93bcad353a68fd4fcf9e4878b22130e02a8] | committer: Carl Eugen Hoyos

avformat/oggparsevorbis: dont use invalid granules

Fixes Ticket3437

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

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

 libavformat/oggparsevorbis.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 36ad738..14c7ddd 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -351,7 +351,7 @@ static int vorbis_packet(AVFormatContext *s, int idx)
      * here we parse the duration of each packet in the first page and compare
      * the total duration to the page granule to find the encoder delay and
      * set the first timestamp */
-    if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & OGG_FLAG_EOS)) {
+    if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & OGG_FLAG_EOS) && (int64_t)os->granule>=0) {
         int seg, d;
         uint8_t *last_pkt  = os->buf + os->pstart;
         uint8_t *next_pkt  = last_pkt;



More information about the ffmpeg-cvslog mailing list