From 238ef6dadd13b9a867eaa7382bdba751e25c40b9 Mon Sep 17 00:00:00 2001 From: Reimar Döffinger Date: Sun, 12 Apr 2009 13:17:37 +0000 Subject: Add a av_fast_malloc function and replace several uses of av_fast_realloc, thus avoiding potential memleaks and pointless memcpys. Originally committed as revision 18470 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/asv1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavcodec/asv1.c') diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c index c9a346addb..0bbf3e63f0 100644 --- a/libavcodec/asv1.c +++ b/libavcodec/asv1.c @@ -408,7 +408,9 @@ static int decode_frame(AVCodecContext *avctx, p->pict_type= FF_I_TYPE; p->key_frame= 1; - a->bitstream_buffer= av_fast_realloc(a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); + av_fast_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); + if (!a->bitstream_buffer) + return AVERROR(ENOMEM); if(avctx->codec_id == CODEC_ID_ASV1) a->dsp.bswap_buf((uint32_t*)a->bitstream_buffer, (const uint32_t*)buf, buf_size/4); -- cgit v1.2.3