summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-07-02 14:56:46 +0200
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-07-02 14:56:46 +0200
commit7a2003e1b7e778d87f4d733e25eb19d661b1a3ba (patch)
tree489e681e000b314f714a05210ff45b1b81d32a1f
parent2cc35d940bc56a31f7f3b0d36a397d7368959da7 (diff)
downloadxine-lib-7a2003e1b7e778d87f4d733e25eb19d661b1a3ba.tar.gz
xine-lib-7a2003e1b7e778d87f4d733e25eb19d661b1a3ba.tar.bz2
Fix demuxing of wavpack files, and avoid crashing with the tags at the end of the file.
-rw-r--r--src/combined/wavpack_demuxer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/combined/wavpack_demuxer.c b/src/combined/wavpack_demuxer.c
index da69731b1..5f2f57d49 100644
--- a/src/combined/wavpack_demuxer.c
+++ b/src/combined/wavpack_demuxer.c
@@ -28,6 +28,7 @@
#define LOG_MODULE "demux_wavpack"
#define LOG_VERBOSE
+#define LOG
#include "xine_internal.h"
#include "xineutils.h"
@@ -230,11 +231,12 @@ static int demux_wv_send_chunk(demux_plugin_t *const this_gen) {
input_time_guess *= buf->extra_info->input_normpos;
input_time_guess /= 65535;
buf->extra_info->input_time = input_time_guess;
+
+ if ( ! header_sent )
+ offset = sizeof(wvheader_t);
- bytes_to_read_now = ( bytes_to_read > buf->max_size ) ? buf->max_size : bytes_to_read;
+ bytes_to_read_now = ( bytes_to_read+offset > buf->max_size ) ? buf->max_size-offset : bytes_to_read;
if ( ! header_sent ) {
- bytes_to_read_now -= (offset = sizeof(wvheader_t));
-
header_sent = 1;
xine_fast_memcpy(buf->content, &header, sizeof(wvheader_t));
}