From d439f5894cc465d055c583f4907288931f8ede7b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 25 Aug 2011 15:54:16 +0200 Subject: [PATCH] Avoid underflow/wrap around --- src/input/r_mpeg_ts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input/r_mpeg_ts.cpp b/src/input/r_mpeg_ts.cpp index 326ca048f..63526c4bf 100644 --- a/src/input/r_mpeg_ts.cpp +++ b/src/input/r_mpeg_ts.cpp @@ -1036,7 +1036,7 @@ mpeg_ts_reader_c::send_to_packetizer(int tid) { //if (tid == 0) // m_file->write(tracks[tid]->payload->get_buffer(), tracks[tid]->payload_size); - if (tracks[tid]->timecode - m_global_timecode_offset < 0) + if (tracks[tid]->timecode < m_global_timecode_offset) tracks[tid]->timecode = 0; else tracks[tid]->timecode = (uint64_t)(tracks[tid]->timecode - m_global_timecode_offset) * 100000ll / 9;