Commit 03a9c993 authored by Michael Niedermayer's avatar Michael Niedermayer

eamad: fix excessive memory allocation.

Fixes Ticket792
Bug found by Oana Stratulat
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 32a92d32
...@@ -268,6 +268,8 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -268,6 +268,8 @@ static int decode_frame(AVCodecContext *avctx,
buf += 16; buf += 16;
if (avctx->width != s->width || avctx->height != s->height) { 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) if (av_image_check_size(s->width, s->height, 0, avctx) < 0)
return -1; return -1;
avcodec_set_dimensions(avctx, s->width, s->height); avcodec_set_dimensions(avctx, s->width, s->height);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment