Mercurial > libavcodec.hg
comparison asv1.c @ 9415:141badec76fc libavcodec
Add a av_fast_malloc function and replace several uses of av_fast_realloc,
thus avoiding potential memleaks and pointless memcpys.
author | reimar |
---|---|
date | Sun, 12 Apr 2009 13:17:37 +0000 |
parents | 4cb7c65fc775 |
children | 0dce4fe6e6f3 |
comparison
equal
deleted
inserted
replaced
9414:5a738e8f9524 | 9415:141badec76fc |
---|---|
406 return -1; | 406 return -1; |
407 } | 407 } |
408 p->pict_type= FF_I_TYPE; | 408 p->pict_type= FF_I_TYPE; |
409 p->key_frame= 1; | 409 p->key_frame= 1; |
410 | 410 |
411 a->bitstream_buffer= av_fast_realloc(a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); | 411 av_fast_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); |
412 if (!a->bitstream_buffer) | |
413 return AVERROR(ENOMEM); | |
412 | 414 |
413 if(avctx->codec_id == CODEC_ID_ASV1) | 415 if(avctx->codec_id == CODEC_ID_ASV1) |
414 a->dsp.bswap_buf((uint32_t*)a->bitstream_buffer, (const uint32_t*)buf, buf_size/4); | 416 a->dsp.bswap_buf((uint32_t*)a->bitstream_buffer, (const uint32_t*)buf, buf_size/4); |
415 else{ | 417 else{ |
416 int i; | 418 int i; |