From 6b168ffb44176c131e802eb8064401bdc2f14299 Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Tue, 11 Oct 2011 20:56:51 +0400 Subject: [PATCH] flvdemux: be careful with negative cts Fixes #661477. --- gst/flv/gstflvdemux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c index 7432520e27..8aa352e53b 100644 --- a/gst/flv/gstflvdemux.c +++ b/gst/flv/gstflvdemux.c @@ -1195,7 +1195,9 @@ gst_flv_demux_parse_tag_video (GstFlvDemux * demux, GstBuffer * buffer) GST_LOG_OBJECT (demux, "got cts %d", cts); - pts = pts + cts; + /* avoid negative overflow */ + if (cts >= 0 || pts >= -cts) + pts += cts; } GST_LOG_OBJECT (demux, "video tag with codec tag %u, keyframe (%d) "