Mercurial > libavcodec.hg
comparison huffyuv.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 |
---|---|
954 AVFrame * const p= &s->picture; | 954 AVFrame * const p= &s->picture; |
955 int table_size= 0; | 955 int table_size= 0; |
956 | 956 |
957 AVFrame *picture = data; | 957 AVFrame *picture = data; |
958 | 958 |
959 s->bitstream_buffer= av_fast_realloc(s->bitstream_buffer, &s->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); | 959 av_fast_malloc(&s->bitstream_buffer, &s->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); |
960 if (!s->bitstream_buffer) | |
961 return AVERROR(ENOMEM); | |
960 | 962 |
961 s->dsp.bswap_buf((uint32_t*)s->bitstream_buffer, (const uint32_t*)buf, buf_size/4); | 963 s->dsp.bswap_buf((uint32_t*)s->bitstream_buffer, (const uint32_t*)buf, buf_size/4); |
962 | 964 |
963 if(p->data[0]) | 965 if(p->data[0]) |
964 avctx->release_buffer(avctx, p); | 966 avctx->release_buffer(avctx, p); |