shithub: openh264

Download patch

ref: e8d045ad53c0d2041e3b45f52251661b048ef1d4
parent: d00519a0fdc290051b4fc89e95832951c601a82d
author: xiaotianshimail <xiaotianshimail@gmail.com>
date: Sat Mar 13 13:28:50 EST 2021

fix oss-fuzz reported issue 31439 (integer range out of scope).

--- a/codec/decoder/core/src/decoder_core.cpp
+++ b/codec/decoder/core/src/decoder_core.cpp
@@ -405,7 +405,7 @@
     //fix Bugzilla 1485229 check if pointers are NULL
     if (pCtx->sRefPic.pRefList[LIST_0][0] && pCtx->sRefPic.pRefList[LIST_1][0]) {
       if (pSliceHeader->uiRefCount[0] == 1 && pSliceHeader->uiRefCount[1] == 1
-          && pCtx->sRefPic.pRefList[LIST_0][0]->iFramePoc + pCtx->sRefPic.pRefList[LIST_1][0]->iFramePoc == 2 * iPoc) {
+          && int64_t(pCtx->sRefPic.pRefList[LIST_0][0]->iFramePoc) + int64_t(pCtx->sRefPic.pRefList[LIST_1][0]->iFramePoc) == 2 * int64_t(iPoc)) {
         pCurDqLayer->bUseWeightedBiPredIdc = false;
         return;
       }