shithub: openh264

Download patch

ref: 756921c62895b4fcb692b5139d59f13acfa20898
parent: d00519a0fdc290051b4fc89e95832951c601a82d
parent: e8d045ad53c0d2041e3b45f52251661b048ef1d4
author: huili2 <[email protected]>
date: Thu Mar 18 05:06:26 EDT 2021

Merge pull request #3372 from xiaotiansf/oss-fuzz-31439

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