From 3d68f5e032c845467e107a19393b270f82034eac Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 30 Mar 2013 20:57:40 +0100 Subject: [PATCH] h264_direct: assert the validity of the spatial ref Signed-off-by: Michael Niedermayer --- libavcodec/h264_direct.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c index 2f49d0ae6f..2d93c2ab60 100644 --- a/libavcodec/h264_direct.c +++ b/libavcodec/h264_direct.c @@ -209,6 +209,7 @@ static void pred_spatial_direct_motion(H264Context * const h, int *mb_type){ mv[list]= AV_RN32A(C); } } + av_assert2(ref[list] < (h->ref_count[list] << !!FRAME_MBAFF(h))); }else{ int mask= ~(MB_TYPE_L0 << (2*list)); mv[list] = 0;