diff options
author | Dirk Leber <tiqq2@gmx.de> | 2008-01-14 18:53:35 +0100 |
---|---|---|
committer | Dirk Leber <tiqq2@gmx.de> | 2008-01-14 18:53:35 +0100 |
commit | 6f90955bba9d996b0fe9080cc4c13d657562af3c (patch) | |
tree | 6da0b53e46954e96fe3c525f8896883c6a722e08 | |
parent | cc96350ed25b072190267641a6af7974524b6d4e (diff) | |
download | xine-lib-6f90955bba9d996b0fe9080cc4c13d657562af3c.tar.gz xine-lib-6f90955bba9d996b0fe9080cc4c13d657562af3c.tar.bz2 |
Signedness bug in Matroska PTS calculation
With some mkv files I had many discontinuity events. I found out that if
changing the timecode_diff in demux_matroska.c from int to int16_t fixes
this problem. Using int will never produce negative values if int is not
16-bit...
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/demuxers/demux_matroska.c | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,6 @@ xine-lib (1.1.17) 2009-??-?? * Build fixes related to ImageMagick 6.4 & later. + * Fix an error in Matroska PTS calculation. * Enable libmpeg2new. This is not yet production code; the old mpeg2 decoder remains the default. * Fix a broken size check in the pvr input plugin (ref. CVE-2008-5239). diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c index 086e0cc98..37f4bd95b 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -1867,7 +1867,7 @@ static int parse_block (demux_matroska_t *this, size_t block_size, uint8_t *data; uint8_t flags; int gap, lacing, num_len; - int timecode_diff; + int16_t timecode_diff; int64_t pts, xduration; int decoder_flags = 0; @@ -1877,7 +1877,7 @@ static int parse_block (demux_matroska_t *this, size_t block_size, data += num_len; /* timecode_diff is signed */ - timecode_diff = parse_int16(data); + timecode_diff = (int16_t)parse_int16(data); data += 2; flags = *data; |