Skip to content
Snippets Groups Projects
Commit f2953365 authored by Daniel Kang's avatar Daniel Kang Committed by Carl Eugen Hoyos
Browse files

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
parent a2b7ed32
Branches
Tags
No related merge requests found
...@@ -54,6 +54,11 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -54,6 +54,11 @@ static int decode_frame(AVCodecContext *avctx,
if(p->data[0]) if(p->data[0])
avctx->release_buffer(avctx, p); 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; p->reference= 0;
if(avctx->get_buffer(avctx, p) < 0){ if(avctx->get_buffer(avctx, p) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment