projects
/
vuplus_dvbapp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a3ccac7
)
tstools: check for wrap arounds in length calculation
author
Felix Domke
<tmbinc@elitedvb.net>
Wed, 8 Feb 2006 00:02:07 +0000
(
00:02
+0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Wed, 8 Feb 2006 00:02:07 +0000
(
00:02
+0000)
lib/dvb/tstools.cpp
patch
|
blob
|
history
diff --git
a/lib/dvb/tstools.cpp
b/lib/dvb/tstools.cpp
index
1b7c5d9
..
bec17a5
100644
(file)
--- a/
lib/dvb/tstools.cpp
+++ b/
lib/dvb/tstools.cpp
@@
-169,6
+169,9
@@
int eDVBTSTools::calcLen(pts_t &len)
if (!(m_begin_valid && m_end_valid))
return -1;
len = m_pts_end - m_pts_begin;
+ /* wrap around? */
+ if (len < 0)
+ len += 0x200000000LL;
return 0;
}
@@
-179,6
+182,10
@@
int eDVBTSTools::calcBitrate()
return -1;
pts_t len_in_pts = m_pts_end - m_pts_begin;
+
+ /* wrap around? */
+ if (len_in_pts < 0)
+ len_in_pts += 0x200000000LL;
off_t len_in_bytes = m_offset_end - m_offset_begin;
if (!len_in_pts)