# HG changeset patch # User Ryan C. Gordon # Date 1067085537 0 # Node ID cd46c97e58bc2505f6e7de80204a940c7e8b195c # Parent ea1eaab18df9288ddaf61921e7d125223d92f42d Fixed broken VOC decoder...would always dereference NULL during VOC_open(). diff -r ea1eaab18df9 -r cd46c97e58bc decoders/voc.c --- a/decoders/voc.c Wed Oct 15 02:22:17 2003 +0000 +++ b/decoders/voc.c Sat Oct 25 12:38:57 2003 +0000 @@ -185,11 +185,10 @@ /* Read next block header, save info, leave position at start of data */ -static int voc_get_block(Sound_Sample *sample) +static int voc_get_block(Sound_Sample *sample, vs_t *v) { Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; SDL_RWops *src = internal->rw; - vs_t *v = (vs_t *) internal->decoder_private; Uint8 bits24[3]; Uint8 uc, block; Uint32 sblen; @@ -384,7 +383,7 @@ if (v->rest == 0) { - if (!voc_get_block(sample)) + if (!voc_get_block(sample, v)) return 0; } /* if */ @@ -457,7 +456,7 @@ v->start_pos = SDL_RWtell(internal->rw); v->rate = -1; - if (!voc_get_block(sample)) + if (!voc_get_block(sample, v)) { free(v); return(0); @@ -502,7 +501,7 @@ break; } /* if */ - if (!voc_get_block(sample)) + if (!voc_get_block(sample, v)) { sample->flags |= (v->error) ? SOUND_SAMPLEFLAG_ERROR : @@ -551,7 +550,7 @@ while (offset > 0) { Uint32 rc = voc_read_waveform(sample, 0, offset); - if ( (rc == 0) || (!voc_get_block(sample)) ) + if ( (rc == 0) || (!voc_get_block(sample, v)) ) { SDL_RWseek(internal->rw, origpos, SEEK_SET); v->rest = origrest;