Skip to content
Snippets Groups Projects
Commit 35034773 authored by Xiang Li's avatar Xiang Li Committed by Frank Bossen
Browse files

Fix crash caused by large MVd

parent c98d4f2b
No related branches found
No related tags found
No related merge requests found
......@@ -3382,6 +3382,18 @@ void EncCu::xEncodeInterResidual( CodingStructure *&tempCS, CodingStructure *&be
int minEMTMode = 0;
int maxEMTMode = (considerEmtSecondPass?1:0);
// Not allow very big |MVd| to avoid CABAC crash caused by too large MVd. Normally no impact on coding performance.
const int maxMvd = 1 << 15;
const PredictionUnit& pu = *cu->firstPU;
if (!cu->affine)
{
if ((pu.refIdx[0] >= 0 && (pu.mvd[0].getAbsHor() >= maxMvd || pu.mvd[0].getAbsVer() >= maxMvd))
|| (pu.refIdx[1] >= 0 && (pu.mvd[1].getAbsHor() >= maxMvd || pu.mvd[1].getAbsVer() >= maxMvd)))
{
return;
}
}
if( emtMode == 2 )
{
minEMTMode = maxEMTMode = (cu->emtFlag?1:0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment