diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index a5bddfaafb..7b6df3bf5f 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -386,14 +386,13 @@ static void prodsum(float *tgt, float *src, int len, int n) } } -void * decode_block(AVCodecContext * avctx, unsigned char *in, signed short int *out) +void * decode_block(AVCodecContext * avctx, unsigned char *in, signed short int *out,unsigned len) { int x,y; Real288_internal *glob=avctx->priv_data; - int cfs=((short*)(avctx->extradata))[3]; /* coded frame size 38 */ - unsigned short int buffer[cfs]; + unsigned short int buffer[len]; - unpack(buffer,in,cfs); + unpack(buffer,in,len); for (x=0;x<32;x++) { glob->phasep=(glob->phase=x&7)*5; @@ -417,30 +416,25 @@ static int ra288_decode_frame(AVCodecContext * avctx, //((short*)(avctx->extradata))[3]; /* coded frame size */ //((short*)(avctx->extradata))[4]; /* codec's data length */ //((short*)(avctx->extradata))[5...] /* codec's data */ - int z,bret; + int bret; void *datao; int w=avctx->block_align; /* 228 */ int h=((short*)(avctx->extradata))[1]; /* 12 */ int cfs=((short*)(avctx->extradata))[3]; /* coded frame size 38 */ int i,j; - unsigned char tb[h*w], *ptb; if(buf_size