Revision e0f7e329 libavcodec/ra288.c

View differences:

libavcodec/ra288.c
228 228
            void *data, int *data_size,
229 229
            uint8_t * buf, int buf_size)
230 230
{
231
  if(avctx->extradata_size>=6)
232
  {
233
//((short*)(avctx->extradata))[0]; /* subpacket size */
234
//((short*)(avctx->extradata))[1]; /* subpacket height */
235
//((short*)(avctx->extradata))[2]; /* subpacket flavour */
236
//((short*)(avctx->extradata))[3]; /* coded frame size */
237
//((short*)(avctx->extradata))[4]; /* codec's data length  */
238
//((short*)(avctx->extradata))[5...] /* codec's data */
239
    int bret;
240 231
    void *datao;
241
    int w=avctx->block_align; /* 228 */
242
    int h=((short*)(avctx->extradata))[1]; /* 12 */
243
    int cfs=((short*)(avctx->extradata))[3]; /* coded frame size 38 */
244
    int i,j;
245
    if(buf_size<w*h)
232

  
233
    if (buf_size < avctx->block_align)
246 234
    {
247
	av_log(avctx, AV_LOG_ERROR, "ffra288: Error! Input buffer is too small [%d<%d]\n",buf_size,w*h);
235
	av_log(avctx, AV_LOG_ERROR, "ffra288: Error! Input buffer is too small [%d<%d]\n",buf_size,avctx->block_align);
248 236
	return 0;
249 237
    }
238

  
250 239
    datao = data;
251
    bret = 0;
252
    for (j = 0; j < h/2; j++)
253
	for (i = 0; i < h; i++)
254
    {
255
	    data=decode_block(avctx,&buf[j*cfs+cfs*i*h/2],(signed short *)data,cfs);
256
	    bret += cfs;
257
    }
240
    data = decode_block(avctx, buf, (signed short *)data, avctx->block_align);
241

  
258 242
    *data_size = (char *)data - (char *)datao;
259
    return bret;
260
  }
261
  else
262
  {
263
    av_log(avctx, AV_LOG_ERROR, "ffra288: Error: need extra data!!!\n");
264
    return 0;
265
  }
243
    return avctx->block_align;
266 244
}
267 245

  
268 246
AVCodec ra_288_decoder =

Also available in: Unified diff