From f851c923d59fbaa73bf1148be3b796b043a7e187 Mon Sep 17 00:00:00 2001 From: Fiona Glaser Date: Wed, 2 Dec 2009 19:55:45 -0800 Subject: [PATCH] Fix crash in interlaced with >8 refs Crash introduced in weightp. --- common/common.h | 2 +- encoder/encoder.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/common.h b/common/common.h index eab28e18..0ba8fb98 100644 --- a/common/common.h +++ b/common/common.h @@ -256,7 +256,7 @@ typedef struct } ref_pic_list_order[2][16]; /* P-frame weighting */ - x264_weight_t weight[16][3]; + x264_weight_t weight[32][3]; int i_mmco_remove_from_end; int i_mmco_command_count; diff --git a/encoder/encoder.c b/encoder/encoder.c index 8f72e3f6..7c20ff39 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -1202,7 +1202,7 @@ static void x264_weighted_pred_init( x264_t *h ) // and duplicates of that frame. h->fenc->i_lines_weighted = 0; - for( i_ref = 0; i_ref < h->i_ref0; i_ref++ ) + for( i_ref = 0; i_ref < (h->i_ref0 << h->sh.b_mbaff); i_ref++ ) for( i = 0; i < 3; i++ ) h->sh.weight[i_ref][i].weightfn = NULL; -- 2.40.0