mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
flvdemux: Avoid integer overflow on invalid CTS
If the CTS is negative an would lead to a negtive PTS, clip the CTS so the PTS will be 0. https://bugzilla.gnome.org/show_bug.cgi?id=787795
This commit is contained in:
parent
9759283612
commit
18dbd49fb8
1 changed files with 6 additions and 0 deletions
|
@ -1502,6 +1502,12 @@ gst_flv_demux_parse_tag_video (GstFlvDemux * demux, GstBuffer * buffer)
|
|||
cts = GST_READ_UINT24_BE (data + 9);
|
||||
cts = (cts + 0xff800000) ^ 0xff800000;
|
||||
|
||||
if (cts < 0 && ABS (cts) > dts) {
|
||||
GST_ERROR_OBJECT (demux, "Detected a negative composition time offset "
|
||||
"'%d' that would lead to negative PTS, fixing", cts);
|
||||
cts += ABS (cts) - dts;
|
||||
}
|
||||
|
||||
GST_LOG_OBJECT (demux, "got cts %d", cts);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue