summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Bigham <dsb@killerbunnies.org>2009-05-31 20:50:13 -0400
committerScott Bigham <dsb@killerbunnies.org>2009-05-31 20:50:13 -0400
commite559c4abdd23b9e41922329b73909acbacbcdffc (patch)
tree6e17c2c951ed40816216f0a2a4f15679790fc7b2
parent9a4144f50bb391cc0e4c93cb053435a453fdf821 (diff)
downloadxine-lib-e559c4abdd23b9e41922329b73909acbacbcdffc.tar.gz
xine-lib-e559c4abdd23b9e41922329b73909acbacbcdffc.tar.bz2
Fix seeking in large raw DV files
start_pos is of type off_t, and since we compile with D_FILE_OFFSET_BITS=64, -off_t is a 64-bit long long int, so you'd think we'd be fine here -- but we aren't, because start_time, this->duration and this->frame_size are all 32-bit ints, which means that the computed seek position gets truncated to 32 bits before it's assigned to start_pos. The simple solution is to cast start_time to off_t, expanding the computation to 64 bits in time to avoid truncation.
-rw-r--r--ChangeLog1
-rw-r--r--src/demuxers/demux_rawdv.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 51d881b2d..45df4f647 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@ xine-lib (1.1.17) 2009-??-??
* Added padding delay to the first and last frames (MPEG audio).
* Fixed buggy discontinuity handling when playing short streams and using the gapless switch. The current time should not be used here.
* Added audio padding handling. (New buffer flag for this.)
+ * Fix seeking in large raw DV files.
xine-lib (1.1.16.3) 2009-04-03
* Security fixes:
diff --git a/src/demuxers/demux_rawdv.c b/src/demuxers/demux_rawdv.c
index 86f777ec6..d95fc9125 100644
--- a/src/demuxers/demux_rawdv.c
+++ b/src/demuxers/demux_rawdv.c
@@ -302,7 +302,8 @@ static int demux_raw_dv_seek (demux_plugin_t *this_gen,
}
if( !start_pos && start_time ) {
- start_pos = (start_time * 90 / this->duration) * this->frame_size;
+ /* Upcast start_time in case sizeof(off_t) > sizeof(int) */
+ start_pos = ((off_t) start_time * 90 / this->duration) * this->frame_size;
}
start_pos = start_pos - (start_pos % this->frame_size);