Converted assert to error checking
Change-Id: Icb8c677f910f588cc7c97e70f024787fe6789257
This commit is contained in:
		@@ -427,11 +427,12 @@ static void read_intra_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
 | 
			
		||||
  mbmi->uv_mode = read_intra_mode_uv(cm, r, mbmi->mode);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static INLINE void assign_mv(VP9_COMMON *cm, MB_PREDICTION_MODE mode,
 | 
			
		||||
static INLINE int assign_mv(VP9_COMMON *cm, MB_PREDICTION_MODE mode,
 | 
			
		||||
                             int_mv mv[2], int_mv best_mv[2],
 | 
			
		||||
                             int_mv nearest_mv[2], int_mv near_mv[2],
 | 
			
		||||
                             int is_compound, int allow_hp, vp9_reader *r) {
 | 
			
		||||
  int i;
 | 
			
		||||
  int ret = 1;
 | 
			
		||||
 | 
			
		||||
  switch (mode) {
 | 
			
		||||
    case NEWMV:
 | 
			
		||||
@@ -440,6 +441,10 @@ static INLINE void assign_mv(VP9_COMMON *cm, MB_PREDICTION_MODE mode,
 | 
			
		||||
       if (is_compound)
 | 
			
		||||
         read_mv(r, &mv[1].as_mv, &best_mv[1].as_mv,
 | 
			
		||||
                 &cm->fc.nmvc, &cm->counts.mv, allow_hp);
 | 
			
		||||
       for (i = 0; i < 1 + is_compound; ++i) {
 | 
			
		||||
         ret = ret && mv[i].as_mv.row < MV_UPP && mv[i].as_mv.row > MV_LOW;
 | 
			
		||||
         ret = ret && mv[i].as_mv.col < MV_UPP && mv[i].as_mv.col > MV_LOW;
 | 
			
		||||
       }
 | 
			
		||||
       break;
 | 
			
		||||
    case NEARESTMV:
 | 
			
		||||
      mv[0].as_int = nearest_mv[0].as_int;
 | 
			
		||||
@@ -457,13 +462,9 @@ static INLINE void assign_mv(VP9_COMMON *cm, MB_PREDICTION_MODE mode,
 | 
			
		||||
        mv[1].as_int = 0;
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      assert(!"Invalid inter mode value.");
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < 1 + is_compound; ++i) {
 | 
			
		||||
    assert(mv[i].as_mv.row < MV_UPP && mv[i].as_mv.row > MV_LOW);
 | 
			
		||||
    assert(mv[i].as_mv.col < MV_UPP && mv[i].as_mv.col > MV_LOW);
 | 
			
		||||
      return 0;
 | 
			
		||||
  }
 | 
			
		||||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int read_is_inter_block(VP9D_COMP *pbi, int segment_id, vp9_reader *r) {
 | 
			
		||||
@@ -559,8 +560,12 @@ static void read_inter_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
 | 
			
		||||
                                          mi_row, mi_col);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        assign_mv(cm, b_mode, block, best, nearest, nearmv,
 | 
			
		||||
                  is_compound, allow_hp, r);
 | 
			
		||||
        if (!assign_mv(cm, b_mode, block, best, nearest, nearmv,
 | 
			
		||||
                       is_compound, allow_hp, r)) {
 | 
			
		||||
          xd->corrupted |= 1;
 | 
			
		||||
          break;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        mi->bmi[j].as_mv[0].as_int = block[0].as_int;
 | 
			
		||||
        if (is_compound)
 | 
			
		||||
@@ -578,7 +583,8 @@ static void read_inter_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
 | 
			
		||||
    mbmi->mv[0].as_int = mi->bmi[3].as_mv[0].as_int;
 | 
			
		||||
    mbmi->mv[1].as_int = mi->bmi[3].as_mv[1].as_int;
 | 
			
		||||
  } else {
 | 
			
		||||
    assign_mv(cm, mbmi->mode, mbmi->mv, best, nearest, nearmv,
 | 
			
		||||
    xd->corrupted |= !assign_mv(cm, mbmi->mode, mbmi->mv,
 | 
			
		||||
                                best, nearest, nearmv,
 | 
			
		||||
                                is_compound, allow_hp, r);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user