diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-07-02 14:55:24 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-07-02 14:55:24 +0200 |
commit | 98b085ddc29581003d76acb79ca4484fcf25b555 (patch) | |
tree | 424ef54c9f369f485c50cd41f70ef148d5a4cc44 /src/combined | |
parent | 2ce81d93218aef7cd8fb362d3e1881237b41b5eb (diff) | |
download | xine-lib-98b085ddc29581003d76acb79ca4484fcf25b555.tar.gz xine-lib-98b085ddc29581003d76acb79ca4484fcf25b555.tar.bz2 |
Fix demuxing of wavpack files, and avoid crashing with the tags at the end of the file.
Diffstat (limited to 'src/combined')
-rw-r--r-- | src/combined/demux_wavpack.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/combined/demux_wavpack.c b/src/combined/demux_wavpack.c index 6a0e33e19..7343976fa 100644 --- a/src/combined/demux_wavpack.c +++ b/src/combined/demux_wavpack.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)); } |