summaryrefslogtreecommitdiff
path: root/apps/codecs/libwavpack/wputils.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libwavpack/wputils.c')
-rw-r--r--apps/codecs/libwavpack/wputils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/codecs/libwavpack/wputils.c b/apps/codecs/libwavpack/wputils.c
index 7fabc7ab34..b0ccd3ba83 100644
--- a/apps/codecs/libwavpack/wputils.c
+++ b/apps/codecs/libwavpack/wputils.c
@@ -69,6 +69,8 @@ WavpackContext *WavpackOpenFileInput (read_stream infile, char *error)
return NULL;
}
+ wps->block_bytes_left = wps->wphdr.ckSize - 24;
+
if ((wps->wphdr.flags & UNKNOWN_FLAGS) || wps->wphdr.version < MIN_STREAM_VERS ||
wps->wphdr.version > MAX_STREAM_VERS) {
strcpy_loc (error, "invalid WavPack file!");
@@ -171,6 +173,8 @@ uint32_t WavpackUnpackSamples (WavpackContext *wpc, int32_t *buffer, uint32_t sa
if (bcount == (uint32_t) -1)
break;
+ wps->block_bytes_left = wps->wphdr.ckSize - 24;
+
if (wps->wphdr.version < MIN_STREAM_VERS || wps->wphdr.version > MAX_STREAM_VERS) {
strcpy_loc (wpc->error_message, "invalid WavPack file!");
break;