summaryrefslogtreecommitdiff
path: root/libavcodec/asv1.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-04-12 13:17:37 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-04-12 13:17:37 +0000
commit238ef6dadd13b9a867eaa7382bdba751e25c40b9 (patch)
treeac0228289581351403ee3f1d9ad187919d498fbb /libavcodec/asv1.c
parent9bf993a5b5f8bf10c590d83c795467606f92cf6e (diff)
downloadffmpeg-238ef6dadd13b9a867eaa7382bdba751e25c40b9.tar.gz
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
Diffstat (limited to 'libavcodec/asv1.c')
-rw-r--r--libavcodec/asv1.c4
1 files changed, 3 insertions, 1 deletions
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);