[FFmpeg-cvslog] avformat/oggparsedaala: Do not adjust AV_NOPTS_VALUE

2018-04-12 Thread Michael Niedermayer
ffmpeg | branch: release/3.3 | Michael Niedermayer  | 
Thu Mar  8 17:28:36 2018 +0100| [3a29fda42ab7da12102d8990859554abfe13996a] | 
committer: Michael Niedermayer

avformat/oggparsedaala: Do not adjust AV_NOPTS_VALUE

Fixes: potential signed integer overflow

Signed-off-by: Michael Niedermayer 
(cherry picked from commit f655ddfb47e8484b205b14c7f871c643ad24d701)
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavformat/oggparsedaala.c b/libavformat/oggparsedaala.c
index a373b41b4c..e944470aca 100644
--- a/libavformat/oggparsedaala.c
+++ b/libavformat/oggparsedaala.c
@@ -218,6 +218,7 @@ static int daala_packet(AVFormatContext *s, int idx)
 int seg, duration = 1;
 struct ogg *ogg = s->priv_data;
 struct ogg_stream *os = ogg->streams + idx;
+int64_t pts;
 
 /*
  * first packet handling: here we parse the duration of each packet in the
@@ -230,7 +231,10 @@ static int daala_packet(AVFormatContext *s, int idx)
 if (os->segments[seg] < 255)
 duration++;
 
-os->lastpts = os->lastdts = daala_gptopts(s, idx, os->granule, NULL) - 
duration;
+pts = daala_gptopts(s, idx, os->granule, NULL);
+if (pts != AV_NOPTS_VALUE)
+pts -= duration;
+os->lastpts = os->lastdts = pts;
 if(s->streams[idx]->start_time == AV_NOPTS_VALUE) {
 s->streams[idx]->start_time = os->lastpts;
 if (s->streams[idx]->duration != AV_NOPTS_VALUE)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/oggparsedaala: Do not adjust AV_NOPTS_VALUE

2018-03-09 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Mar  8 17:28:36 2018 +0100| [f655ddfb47e8484b205b14c7f871c643ad24d701] | 
committer: Michael Niedermayer

avformat/oggparsedaala: Do not adjust AV_NOPTS_VALUE

Fixes: potential signed integer overflow

Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavformat/oggparsedaala.c b/libavformat/oggparsedaala.c
index a373b41b4c..e944470aca 100644
--- a/libavformat/oggparsedaala.c
+++ b/libavformat/oggparsedaala.c
@@ -218,6 +218,7 @@ static int daala_packet(AVFormatContext *s, int idx)
 int seg, duration = 1;
 struct ogg *ogg = s->priv_data;
 struct ogg_stream *os = ogg->streams + idx;
+int64_t pts;
 
 /*
  * first packet handling: here we parse the duration of each packet in the
@@ -230,7 +231,10 @@ static int daala_packet(AVFormatContext *s, int idx)
 if (os->segments[seg] < 255)
 duration++;
 
-os->lastpts = os->lastdts = daala_gptopts(s, idx, os->granule, NULL) - 
duration;
+pts = daala_gptopts(s, idx, os->granule, NULL);
+if (pts != AV_NOPTS_VALUE)
+pts -= duration;
+os->lastpts = os->lastdts = pts;
 if(s->streams[idx]->start_time == AV_NOPTS_VALUE) {
 s->streams[idx]->start_time = os->lastpts;
 if (s->streams[idx]->duration != AV_NOPTS_VALUE)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog