shithub: openh264

Download patch

ref: d422ee59ad5c88ff0f87c47945c7f780b042b9c2
parent: 091e5cba0ae5006914c00ba0387cf29ab680f75f
parent: ac061fe635ebe164fa7582577c1bd110a117331e
author: huili2 <huili2@cisco.com>
date: Mon Dec 15 10:39:46 EST 2014

Merge pull request #1626 from dongzha/testcrash1

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];