avformat/oggparsevorbis: dont use invalid granules

Fixes Ticket3437

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 12b97dd375)
This commit is contained in:
Michael Niedermayer 2014-03-05 17:07:28 +01:00 committed by Carl Eugen Hoyos
parent 96603d5753
commit d87ac93bca
1 changed files with 1 additions and 1 deletions

View File

@ -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;