summaryrefslogtreecommitdiff
path: root/libavcodec/huffyuv.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/huffyuv.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/huffyuv.c')
-rw-r--r--libavcodec/huffyuv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c
index 59437b1a0f..de1118dd1d 100644
--- a/libavcodec/huffyuv.c
+++ b/libavcodec/huffyuv.c
@@ -956,7 +956,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
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);