diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-11 12:47:11 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-28 11:47:27 -0400 |
commit | 11ca8b2d7486e879926488404b3b79af774f0f2d (patch) | |
tree | 2632c06cb57df6125687912369e85510c29a8492 | |
parent | 91b71460b5b2ba1060314d5811029159a013fcac (diff) | |
download | ffmpeg-11ca8b2d7486e879926488404b3b79af774f0f2d.tar.gz |
apedec: check for data buffer realloc failure
-rw-r--r-- | libavcodec/apedec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index a754fd75b0..2041e2b3c5 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -824,7 +824,10 @@ static int ape_decode_frame(AVCodecContext *avctx, } if(!s->samples){ - s->data = av_realloc(s->data, (buf_size + 3) & ~3); + void *tmp_data = av_realloc(s->data, (buf_size + 3) & ~3); + if (!tmp_data) + return AVERROR(ENOMEM); + s->data = tmp_data; s->dsp.bswap_buf((uint32_t*)s->data, (const uint32_t*)buf, buf_size >> 2); s->ptr = s->last_ptr = s->data; s->data_end = s->data + buf_size; |