[x264-devel] commit: Fix some invalid reads caught by valgrind (Jason Garrett-Glaser )

git version control git at videolan.org
Thu Jan 14 05:51:06 CET 2010


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Thu Dec 31 02:57:45 2009 -0500| [1b68cbd27b24759f64c72effdae42f184a20546e] | committer: Jason Garrett-Glaser 

Fix some invalid reads caught by valgrind
Temporal predictor calculation was misled by invalid reference counts for I-frames.

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

 encoder/encoder.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/encoder/encoder.c b/encoder/encoder.c
index 6c57840..5de6bdc 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -1339,8 +1339,11 @@ static inline void x264_reference_build_list( x264_t *h, int i_poc )
     int b_ok;
 
     /* build ref list 0/1 */
-    h->i_ref0 = 0;
-    h->i_ref1 = 0;
+    h->mb.pic.i_fref[0] = h->i_ref0 = 0;
+    h->mb.pic.i_fref[1] = h->i_ref1 = 0;
+    if( h->sh.i_type == SLICE_TYPE_I )
+        return;
+
     for( i = 0; h->frames.reference[i]; i++ )
     {
         if( h->frames.reference[i]->i_poc < i_poc )



More information about the x264-devel mailing list