Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-10-11 20:47:11 +0400
committerMichael Niedermayer <michaelni@gmx.at>2011-11-04 06:23:39 +0400
commit43fa5bf55ed5e1a26fff6d0cd434fb911250ee9a (patch)
treed60d8d497f3ea15c19be0d2d4b48c00bbd310cc9 /libavcodec
parentf19b8d95335a9fb616c7c1d806d3dd3abda031c9 (diff)
apedec: check for data buffer realloc failure
(cherry picked from commit 11ca8b2d7486e879926488404b3b79af774f0f2d) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/apedec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 7cf72a00bd..4c2d238b16 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -819,7 +819,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;