Commit dffb85a9 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpegvideo: check that linesize is not too small

Note linesize is rounded up to at least a multiple of 8
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 4a0ec85b
...@@ -434,6 +434,11 @@ static int frame_size_alloc(MpegEncContext *s, int linesize) ...@@ -434,6 +434,11 @@ static int frame_size_alloc(MpegEncContext *s, int linesize)
{ {
int alloc_size = FFALIGN(FFABS(linesize) + 64, 32); int alloc_size = FFALIGN(FFABS(linesize) + 64, 32);
if (linesize < 24) {
av_log(s->avctx, AV_LOG_ERROR, "Image too small, temporary buffers cannot function\n");
return AVERROR_PATCHWELCOME;
}
// edge emu needs blocksize + filter length - 1 // edge emu needs blocksize + filter length - 1
// (= 17x17 for halfpel / 21x21 for h264) // (= 17x17 for halfpel / 21x21 for h264)
// VC1 computes luma and chroma simultaneously and needs 19X19 + 9x9 // VC1 computes luma and chroma simultaneously and needs 19X19 + 9x9
......
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