shithub: openh264

Download patch

ref: ac061fe635ebe164fa7582577c1bd110a117331e
parent: 091e5cba0ae5006914c00ba0387cf29ab680f75f
author: dongzha <[email protected]>
date: Mon Dec 15 09:47:55 EST 2014

add protection

--- a/codec/decoder/core/src/error_concealment.cpp
+++ b/codec/decoder/core/src/error_concealment.cpp
@@ -198,8 +198,8 @@
     } else {
       iScale0 = pCtx->pECRefPic[0]->iFramePoc - iCurrPoc;
       iScale1 = pRef->iFramePoc - iCurrPoc;
-      iMVs[0] = pCtx->iECMVs[0][0] * iScale1 / iScale0;
-      iMVs[1] = pCtx->iECMVs[0][1] * iScale1 / iScale0;
+      iMVs[0] = iScale0 == 0 ? 0 : pCtx->iECMVs[0][0] * iScale1 / iScale0;
+      iMVs[1] = iScale0 == 0 ? 0 : pCtx->iECMVs[0][1] * iScale1 / iScale0;
     }
     pMCRefMem->pDstY = pDst[0];
     pMCRefMem->pDstU = pDst[1];