diff --git a/stb_vorbis.c b/stb_vorbis.c index 9030c31..ea753df 100644 --- a/stb_vorbis.c +++ b/stb_vorbis.c @@ -1693,9 +1693,9 @@ static int codebook_decode_scalar(vorb *f, Codebook *c) // CODEBOOK_ELEMENT_FAST is an optimization for the CODEBOOK_FLOATS case // where we avoid one addition -#define CODEBOOK_ELEMENT(c,off) (c->multiplicands[off] * c->delta_value + c->minimum_value) -#define CODEBOOK_ELEMENT_FAST(c,off) (c->multiplicands[off] * c->delta_value) -#define CODEBOOK_ELEMENT_BASE(c) (c->minimum_value) +#define CODEBOOK_ELEMENT(c,off) (c->multiplicands[off]) +#define CODEBOOK_ELEMENT_FAST(c,off) (c->multiplicands[off]) +#define CODEBOOK_ELEMENT_BASE(c) (0) static int codebook_decode_start(vorb *f, Codebook *c) { diff --git a/tests/test_vorbis.c b/tests/test_vorbis.c index a41c02c..d54ed23 100644 --- a/tests/test_vorbis.c +++ b/tests/test_vorbis.c @@ -8,10 +8,11 @@ extern void stb_vorbis_dumpmem(void); int main(int argc, char **argv) { size_t memlen; - unsigned char *mem = stb_fileu("c:/x/vorbis/stb_vorbis_crash.ogg", &memlen); + unsigned char *mem = stb_fileu("c:/x/sketch008.ogg", &memlen); int chan, samplerate; short *output; int samples = stb_vorbis_decode_memory(mem, memlen, &chan, &samplerate, &output); + stb_filewrite("c:/x/sketch008.raw", output, samples*4); return 0; } #endif