[x264-devel] commit: shut up valgrind warnings in trellis (Loren Merritt )

git version control git at videolan.org
Wed Jul 22 22:33:13 CEST 2009


x264 | branch: master | Loren Merritt <pengvado at akuvian.org> | Wed Jul 22 20:20:52 2009 +0000| [29569051505a78db9dbbc8fda53ab11e7e08b994] | committer: Loren Merritt 

shut up valgrind warnings in trellis

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

 encoder/rdo.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/encoder/rdo.c b/encoder/rdo.c
index eac0959..84fb9ed 100644
--- a/encoder/rdo.c
+++ b/encoder/rdo.c
@@ -609,11 +609,13 @@ static ALWAYS_INLINE int quant_trellis_cabac( x264_t *h, int16_t *dct,
     }
 
     j = bnode->level_idx;
-    for( i = b_ac; i < i_coefs; i++ )
+    for( i = b_ac; j; i++ )
     {
         dct[zigzag[i]] = level_tree[j].abs_level * signs[i];
         j = level_tree[j].next;
     }
+    for( ; i < i_coefs; i++ )
+        dct[zigzag[i]] = 0;
 
     return 1;
 }



More information about the x264-devel mailing list