summaryrefslogtreecommitdiff
path: root/libavcodec/eamad.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-03 23:16:54 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-03 23:17:37 +0200
commite756635964ed3aa1ee997465f9b46143bcb5d894 (patch)
tree522966708021ed389c540e07e0c4884416901885 /libavcodec/eamad.c
parentb937d3694e54c6e3203a0afd3ca47be77c78f495 (diff)
eamad: Check against minimum supported dimensions
Fixes out of array reads Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/eamad.c')
-rw-r--r--libavcodec/eamad.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 58cdea6753..b6bf86d307 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -257,6 +257,11 @@ static int decode_frame(AVCodecContext *avctx,
calc_quant_matrix(s, buf[13]);
buf += 16;
+ if (width < 16 || height < 16) {
+ av_log(avctx, AV_LOG_ERROR, "Dimensions too small\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (avctx->width != width || avctx->height != height) {
if((width * height)/2048*7 > buf_end-buf)
return AVERROR_INVALIDDATA;