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.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/codecs/libwavpack/wputils.c b/apps/codecs/libwavpack/wputils.c
index 1b8fae0e67..9227b66e46 100644
--- a/apps/codecs/libwavpack/wputils.c
+++ b/apps/codecs/libwavpack/wputils.c
@@ -19,6 +19,8 @@
19 19
20#include <string.h> 20#include <string.h>
21 21
22static void strcpy_loc (char *dst, char *src) { while (*src) *dst++ = *src++; *dst = 0; }
23
22///////////////////////////// local table storage //////////////////////////// 24///////////////////////////// local table storage ////////////////////////////
23 25
24const ulong sample_rates [] = { 6000, 8000, 9600, 11025, 12000, 16000, 22050, 26const ulong sample_rates [] = { 6000, 8000, 9600, 11025, 12000, 16000, 22050,
@@ -49,7 +51,6 @@ WavpackContext *WavpackOpenFileInput (read_stream infile, char *error)
49{ 51{
50 WavpackStream *wps = &wpc.stream; 52 WavpackStream *wps = &wpc.stream;
51 ulong bcount; 53 ulong bcount;
52 (void)error;
53 54
54 CLEAR (wpc); 55 CLEAR (wpc);
55 wpc.infile = infile; 56 wpc.infile = infile;
@@ -64,12 +65,12 @@ WavpackContext *WavpackOpenFileInput (read_stream infile, char *error)
64 bcount = read_next_header (wpc.infile, &wps->wphdr); 65 bcount = read_next_header (wpc.infile, &wps->wphdr);
65 66
66 if (bcount == (ulong) -1) { 67 if (bcount == (ulong) -1) {
67 /*strcpy (error, "not compatible with this version of WavPack file!");*/ 68 strcpy_loc (error, "invalid WavPack file!");
68 return NULL; 69 return NULL;
69 } 70 }
70 71
71 if ((wps->wphdr.flags & UNKNOWN_FLAGS) || wps->wphdr.version < 0x402 || wps->wphdr.version > 0x40f) { 72 if ((wps->wphdr.flags & UNKNOWN_FLAGS) || wps->wphdr.version < 0x402 || wps->wphdr.version > 0x40f) {
72 /*strcpy (error, "not compatible with this version of WavPack file!");*/ 73 strcpy_loc (error, "invalid WavPack file!");
73 return NULL; 74 return NULL;
74 } 75 }
75 76
@@ -77,8 +78,8 @@ WavpackContext *WavpackOpenFileInput (read_stream infile, char *error)
77 wpc.total_samples = wps->wphdr.total_samples; 78 wpc.total_samples = wps->wphdr.total_samples;
78 79
79 if (!unpack_init (&wpc)) { 80 if (!unpack_init (&wpc)) {
80 /*strcpy (error, wpc.error_message [0] ? wpc.error_message : 81 strcpy_loc (error, wpc.error_message [0] ? wpc.error_message :
81 "not compatible with this version of WavPack file!");*/ 82 "invalid WavPack file!");
82 83
83 return NULL; 84 return NULL;
84 } 85 }
@@ -170,7 +171,7 @@ ulong WavpackUnpackSamples (WavpackContext *wpc, long *buffer, ulong samples)
170 break; 171 break;
171 172
172 if (wps->wphdr.version < 0x402 || wps->wphdr.version > 0x40f) { 173 if (wps->wphdr.version < 0x402 || wps->wphdr.version > 0x40f) {
173 /*strcpy (wpc->error_message, "not compatible with this version of WavPack file!");*/ 174 strcpy_loc (wpc->error_message, "invalid WavPack file!");
174 break; 175 break;
175 } 176 }
176 177