﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1043	Decoder crashes when encoding with command options: --MMVD=0 --FastMrg=0 --MaxNumMergeCand=1 --MaxNumGeoCand=0	tsukuba.takeshi		"At VTM-8.0 or the latest VTM, decoder crashes when encoding with command options: --MMVD=0 --FastMrg=0 --MaxNumMergeCand=1 --MaxNumGeoCand=0.

This bug comes from the candNum setting at void EncCu::xCheckRDCostMerge2Nx2N(...).

When using option: --MMVD=0 --FastMrg=0 --MaxNumMergeCand=1 --MaxNumGeoCand=0, 
the parameter candNum is still set to MRG_MAX_NUM_CANDS. 
Thus, RdModeList can contain MMVD candidate at for-loop although MMVD is disabled.

{{{ 
EncCu::xCheckRDCostMerge2Nx2N(...){
...
  const int candNum = MRG_MAX_NUM_CANDS + (tempCS->sps->getUseMMVD() ? MMVD_ADD_NUM : 0);

  for (int i = 0; i < candNum; i++)
  {
    if (i < mergeCtx.numValidMergeCand)
    {
      RdModeList.push_back(ModeInfo(i, true, false, false));
    }
    else
    {
      RdModeList.push_back(ModeInfo(std::min(MMVD_ADD_NUM, i - mergeCtx.numValidMergeCand), false, true, false));
    }
  }
...
}
}}}

candNum should be set to '''mergeCtx.numValidMergeCand''' + (tempCS->sps->getUseMMVD() ? MMVD_ADD_NUM : 0).

"	defect	closed	minor		VTM	VTM-8.0	fixed		ksuehring XiangLi fbossen jvet@…
