aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-19 16:27:52 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 19:49:56 +0100
commit54cfb532a09f18e5da78722e94b23afb25f7ceca (patch)
treeb133d2326d745056004e9dfad8e8e68b991017bd
parente9a7ab20be424b2175fdd4a74e98046a1ff6e36c (diff)
downloadffmpeg-54cfb532a09f18e5da78722e94b23afb25f7ceca.tar.gz
eamad: fix excessive memory allocation.
Fixes Ticket792 Bug found by Oana Stratulat Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 03a9c9932dbceff4d42d82b9c4fccf860093f0e9) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/eamad.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 1f6282394e..cc6f9d38ef 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -268,6 +268,8 @@ static int decode_frame(AVCodecContext *avctx,
buf += 16;
if (avctx->width != s->width || avctx->height != s->height) {
+ if((s->width * s->height)/2048*7 > buf_end-buf)
+ return -1;
if (av_image_check_size(s->width, s->height, 0, avctx) < 0)
return -1;
avcodec_set_dimensions(avctx, s->width, s->height);