1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

Check if buffer is large enough for given resolution.

Fixes issue 2501.

Patch by Daniel Kang, daniel.d.kang at gmail

Originally committed as revision 26258 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Daniel Kang 2011-01-07 21:54:52 +00:00 committed by Carl Eugen Hoyos
parent a2b7ed3274
commit f2953365d1

View File

@ -54,6 +54,11 @@ static int decode_frame(AVCodecContext *avctx,
if(p->data[0])
avctx->release_buffer(avctx, p);
if(buf_size/avctx->height < avctx->width) {
av_log(avctx, AV_LOG_ERROR, "Resolution larger than buffer size. Invalid header?\n");
return -1;
}
p->reference= 0;
if(avctx->get_buffer(avctx, p) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");