# HG changeset patch # User melanson # Date 1110090144 0 # Node ID e8f1f57215ad922fadc77b70f6d8fa8b3c17f936 # Parent a27a580f292e719978e188fae36b1b77da0543ee do not use a variable before proper initialization diff -r a27a580f292e -r e8f1f57215ad alac.c --- a/alac.c Sun Mar 06 00:43:55 2005 +0000 +++ b/alac.c Sun Mar 06 06:22:24 2005 +0000 @@ -97,7 +97,7 @@ void alac_set_info(alac_file *alac, char *inputbuffer) { - char *ptr = inputbuffer; + unsigned char *ptr = inputbuffer; ptr += 4; /* size */ ptr += 4; /* alac */ @@ -134,7 +134,7 @@ if (alac->input_buffer_index + 2 >= alac->input_buffer_size) { av_log(NULL, AV_LOG_INFO, "alac: input buffer went out of bounds (%d >= %d)\n", alac->input_buffer_index + 2, alac->input_buffer_size); - exit (0); +// exit (0); } result = (alac->input_buffer[alac->input_buffer_index + 0] << 16) | (alac->input_buffer[alac->input_buffer_index + 1] << 8) | @@ -186,7 +186,7 @@ if (alac->input_buffer_index >= alac->input_buffer_size) { av_log(NULL, AV_LOG_INFO, "alac: input buffer went out of bounds (%d >= %d)\n", alac->input_buffer_index + 2, alac->input_buffer_size); - exit (0); +// exit (0); } result = alac->input_buffer[alac->input_buffer_index]; @@ -488,8 +488,8 @@ int16_t *buffer_out, int numchannels, int numsamples, uint8_t interlacing_shift, - uint8_t interlacing_leftweight) { - + uint8_t interlacing_leftweight) +{ int i; if (numsamples <= 0) return; @@ -546,10 +546,10 @@ int decode_frame(ALACContext *s, alac_file *alac, unsigned char *inbuffer, int input_buffer_size, - void *outbuffer, int *outputsize){ - + void *outbuffer, int *outputsize) +{ int channels; - int32_t outputsamples = alac->setinfo_max_samples_per_frame; + int32_t outputsamples; /* initialize from the extradata */ if (!s->context_initialized) { @@ -561,7 +561,8 @@ alac_set_info(s->alac, s->avctx->extradata); s->context_initialized = 1; } - + + outputsamples = alac->setinfo_max_samples_per_frame; /* setup the stream */ alac->input_buffer = inbuffer;