Commit 68a55021 authored by Anton Mitrofanov's avatar Anton Mitrofanov
Browse files

mbtree: Fix buffer overflow

Could occur on the 1st pass in combination with --fake-interlaced and
some input heights due to allocating a too small buffer.
parent df79067c
......@@ -420,7 +420,7 @@ static int x264_macroblock_tree_rescale_init( x264_t *h, x264_ratecontrol_t *rc
float dstdim[2] = { h->param.i_width / 16.f, h->param.i_height / 16.f};
int srcdimi[2] = {ceil(srcdim[0]), ceil(srcdim[1])};
int dstdimi[2] = {ceil(dstdim[0]), ceil(dstdim[1])};
if( h->param.b_interlaced || h->param.b_fake_interlaced )
srcdimi[1] = (srcdimi[1]+1)&~1;
dstdimi[1] = (dstdimi[1]+1)&~1;
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