# HG changeset patch # User Ryan C. Gordon # Date 1000909986 0 # Node ID ddc3614c9042cb5ec0481b19218921fdd1d3a7d1 # Parent 4acb5260d6846857c58e5281bf5f324d3eaa31ce Bugfix (thanks Tsuyoshi Iguchi!), and Ogg Vorbis decoder entry. diff -r 4acb5260d684 -r ddc3614c9042 SDL_sound.c --- a/SDL_sound.c Wed Sep 19 14:05:36 2001 +0000 +++ b/SDL_sound.c Wed Sep 19 14:33:06 2001 +0000 @@ -52,6 +52,10 @@ extern const Sound_DecoderFunctions __Sound_DecoderFunctions_WAV; #endif +#if (defined SOUND_SUPPORTS_OGG) +extern const Sound_DecoderFunctions __Sound_DecoderFunctions_OGG; +#endif + #if (defined SOUND_SUPPORTS_VOC) extern const Sound_DecoderFunctions __Sound_DecoderFunctions_VOC; #endif @@ -70,6 +74,10 @@ &__Sound_DecoderFunctions_WAV, #endif +#if (defined SOUND_SUPPORTS_OGG) + &__Sound_DecoderFunctions_OGG, +#endif + #if (defined SOUND_SUPPORTS_VOC) &__Sound_DecoderFunctions_VOC, #endif @@ -114,14 +122,15 @@ for (i = 0; decoderFuncs[i] != NULL; i++) ; /* do nothing. */ - i++; available_decoders = (const Sound_DecoderInfo **) - malloc(i * sizeof (Sound_DecoderInfo *)); + malloc((i + 1) * sizeof (Sound_DecoderInfo *)); BAIL_IF_MACRO(available_decoders == NULL, ERR_OUT_OF_MEMORY, 0); for (i = 0; decoderFuncs[i] != NULL; i++) available_decoders[i] = &decoderFuncs[i]->info; + available_decoders[i] = NULL; + initialized = 1; return(1); } /* Sound_Init */