[x264-devel] Fix theoretically incorrect cost_mv_fpel free

Anton Mitrofanov git at videolan.org
Tue Aug 7 00:05:16 CEST 2018


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Sun Apr  1 17:52:47 2018 +0300| [6afb67c6d7b71fcc6fc14d167f1fcf55623846f4] | committer: Henrik Gramner

Fix theoretically incorrect cost_mv_fpel free

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

 encoder/analyse.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/encoder/analyse.c b/encoder/analyse.c
index c313664d..e3e51f4f 100644
--- a/encoder/analyse.c
+++ b/encoder/analyse.c
@@ -208,9 +208,11 @@ void x264_analyse_free_costs( x264_t *h )
     {
         if( h->cost_mv[i] )
             x264_free( h->cost_mv[i] - 2*4*mv_range );
-        if( h->cost_mv_fpel[i][0] )
-            for( int j = 0; j < 4; j++ )
+        for( int j = 0; j < 4; j++ )
+        {
+            if( h->cost_mv_fpel[i][j] )
                 x264_free( h->cost_mv_fpel[i][j] - 2*mv_range );
+        }
     }
 }
 



More information about the x264-devel mailing list