[x264-devel] mbtree: Fix buffer overflow

Anton Mitrofanov git at videolan.org
Mon Jun 26 21:58:04 CEST 2017


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Thu Jun  8 18:35:21 2017 +0300| [68a550217c8d0fae6229c5b322b6810fe9652ef3] | committer: Anton Mitrofanov

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.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=68a550217c8d0fae6229c5b322b6810fe9652ef3
---

 encoder/ratecontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index 79e73878..4ed1d993 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -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( PARAM_INTERLACED )
+    if( h->param.b_interlaced || h->param.b_fake_interlaced )
     {
         srcdimi[1] = (srcdimi[1]+1)&~1;
         dstdimi[1] = (dstdimi[1]+1)&~1;



More information about the x264-devel mailing list