ffmpeg: add image size check to codec_get_buffer()

Fixes CVE-2011-3935

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-01-25 06:32:05 +01:00
parent 28d634711b
commit 668494acd8

View File

@ -546,6 +546,9 @@ static int codec_get_buffer(AVCodecContext *s, AVFrame *frame)
FrameBuffer *buf;
int ret, i;
if(av_image_check_size(s->width, s->height, 0, s))
return -1;
if (!ist->buffer_pool && (ret = alloc_buffer(s, ist, &ist->buffer_pool)) < 0)
return ret;