ff_h264_direct_ref_list_init: fix B slice check.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 18 Nov 2012 17:46:05 +0000 (18:46 +0100)
committerJanne Grunau <janne-libav@jannau.net>
Tue, 18 Dec 2012 18:44:22 +0000 (19:44 +0100)
Fixes null pointer dereference.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
libavcodec/h264_direct.c

index a33efa5..bf44495 100644 (file)
@@ -134,7 +134,7 @@ void ff_h264_direct_ref_list_init(H264Context * const h){
         h->col_fieldoff = 2 * h->ref_list[1][0].f.reference - 3;
     }
 
-    if (cur->f.pict_type != AV_PICTURE_TYPE_B || h->direct_spatial_mv_pred)
+    if (h->slice_type_nos != AV_PICTURE_TYPE_B || h->direct_spatial_mv_pred)
         return;
 
     for(list=0; list<2; list++){