diff options
author | Mike Melanson <mike@multimedia.cx> | 2005-03-06 06:22:24 +0000 |
---|---|---|
committer | Mike Melanson <mike@multimedia.cx> | 2005-03-06 06:22:24 +0000 |
commit | 7ff85a81edcb10da52a9e37e1f99765a0d96854a (patch) | |
tree | ea2c1c00467ff7fcf49ff958f6080a7bfb355889 /libavcodec/alac.c | |
parent | 6d6d7970e7c0ae1bf3f0e015d3c22723ed5b1a28 (diff) | |
download | ffmpeg-7ff85a81edcb10da52a9e37e1f99765a0d96854a.tar.gz |
do not use a variable before proper initialization
Originally committed as revision 4009 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r-- | libavcodec/alac.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 0523707381..8231fb1f67 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -97,7 +97,7 @@ static void allocate_buffers(alac_file *alac) 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 @@ static uint32_t readbits_16(alac_file *alac, int bits) 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 @@ static int readbit(alac_file *alac) 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 @@ void deinterlace_16(int32_t *buffer_a, int32_t *buffer_b, 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 @@ void deinterlace_16(int32_t *buffer_a, int32_t *buffer_b, 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 @@ int decode_frame(ALACContext *s, alac_file *alac, 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; |