Mercurial > libavcodec.hg
diff 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 |
line wrap: on
line diff
--- a/huffyuv.c Sun Apr 12 12:25:53 2009 +0000 +++ b/huffyuv.c Sun Apr 12 13:17:37 2009 +0000 @@ -956,7 +956,9 @@ AVFrame *picture = data; - s->bitstream_buffer= av_fast_realloc(s->bitstream_buffer, &s->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); + av_fast_malloc(&s->bitstream_buffer, &s->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); + if (!s->bitstream_buffer) + return AVERROR(ENOMEM); s->dsp.bswap_buf((uint32_t*)s->bitstream_buffer, (const uint32_t*)buf, buf_size/4);