Skip to content

Commit a8a5734

Browse files
committed
adpcm-xq: try decoding anyway
thanks Architect!
1 parent c078593 commit a8a5734

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

extern/adpcm-xq-s/adpcm-lib.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,10 @@ int adpcm_decode_block (int16_t *outbuf, const uint8_t *inbuf, size_t inbufsize,
352352
*outbuf++ = pcmdata[0] = (int16_t) (inbuf [0] | (inbuf [1] << 8));
353353
index[0] = inbuf [2];
354354

355+
// tildearrow: don't return if this fails. try decoding a corrupt sample anyway.
356+
// thanks Architect!
355357
if (index [0] < 0 || index [0] > 88 || inbuf [3]) // sanitize the input a little...
356-
return 0;
358+
index[0] = 0;
357359

358360
inbufsize -= 4;
359361
inbuf += 4;

0 commit comments

Comments
 (0)