diff options
Diffstat (limited to 'apps/codecs/wav64.c')
-rw-r--r-- | apps/codecs/wav64.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/apps/codecs/wav64.c b/apps/codecs/wav64.c index a9e5ca126a..f70fb53ba4 100644 --- a/apps/codecs/wav64.c +++ b/apps/codecs/wav64.c | |||
@@ -163,7 +163,6 @@ enum codec_status codec_main(void) | |||
163 | { | 163 | { |
164 | int status = CODEC_OK; | 164 | int status = CODEC_OK; |
165 | uint32_t decodedsamples; | 165 | uint32_t decodedsamples; |
166 | uint32_t i; | ||
167 | size_t n; | 166 | size_t n; |
168 | int bufcount; | 167 | int bufcount; |
169 | int endofstream; | 168 | int endofstream; |
@@ -255,10 +254,10 @@ next_track: | |||
255 | } | 254 | } |
256 | else | 255 | else |
257 | { | 256 | { |
258 | format.size = buf[40]|(buf[41]<<8); | ||
259 | if (format.formattag != WAVE_FORMAT_EXTENSIBLE) | 257 | if (format.formattag != WAVE_FORMAT_EXTENSIBLE) |
260 | format.samplesperblock = buf[42]|(buf[43]<<8); | 258 | format.samplesperblock = buf[42]|(buf[43]<<8); |
261 | else { | 259 | else { |
260 | format.size = buf[40]|(buf[41]<<8); | ||
262 | if (format.size < 22) { | 261 | if (format.size < 22) { |
263 | DEBUGF("CODEC_ERROR: WAVE_FORMAT_EXTENSIBLE is " | 262 | DEBUGF("CODEC_ERROR: WAVE_FORMAT_EXTENSIBLE is " |
264 | "missing extension\n"); | 263 | "missing extension\n"); |
@@ -320,10 +319,10 @@ next_track: | |||
320 | } | 319 | } |
321 | 320 | ||
322 | /* go to next chunk (8byte bound) */ | 321 | /* go to next chunk (8byte bound) */ |
323 | if (size & 0x07) | 322 | size += 24 + ((1 + ~size) & 0x07); |
324 | size += 8 - (size & 0x7); | 323 | |
325 | ci->advance_buffer(size + 24); | 324 | ci->advance_buffer(size); |
326 | firstblockposn += size + 24; | 325 | firstblockposn += size; |
327 | } | 326 | } |
328 | 327 | ||
329 | if (!codec) | 328 | if (!codec) |
@@ -347,7 +346,7 @@ next_track: | |||
347 | if (format.blockalign == 0) | 346 | if (format.blockalign == 0) |
348 | { | 347 | { |
349 | DEBUGF("CODEC_ERROR: 'fmt ' chunk not found or 0-blockalign file\n"); | 348 | DEBUGF("CODEC_ERROR: 'fmt ' chunk not found or 0-blockalign file\n"); |
350 | i = CODEC_ERROR; | 349 | status = CODEC_ERROR; |
351 | goto done; | 350 | goto done; |
352 | } | 351 | } |
353 | if (format.numbytes == 0) { | 352 | if (format.numbytes == 0) { |
@@ -363,7 +362,7 @@ next_track: | |||
363 | if (format.chunksize == 0) | 362 | if (format.chunksize == 0) |
364 | { | 363 | { |
365 | DEBUGF("CODEC_ERROR: chunksize is 0\n"); | 364 | DEBUGF("CODEC_ERROR: chunksize is 0\n"); |
366 | i = CODEC_ERROR; | 365 | status = CODEC_ERROR; |
367 | goto done; | 366 | goto done; |
368 | } | 367 | } |
369 | 368 | ||