Merge pull request #2380 from mstorsjo/fix-slice-realloc

Avoid reading iCountMbNumInSlice out of bounds on slice realloc
This commit is contained in:
sijchen 2016-02-26 09:46:13 -08:00
commit 7e88b13809

View File

@ -4877,7 +4877,7 @@ int32_t SliceBufferRealloc (sWelsEncCtx* pCtx) {
pSliceIdx->sSlicingOverRc.iTotalQpSlice = 0;
pSliceIdx->sSlicingOverRc.iTotalMbSlice = 0;
pSliceIdx->sSlicingOverRc.iTargetBitsSlice = WELS_DIV_ROUND (kiBitsPerMb *
pCurLayer->sLayerInfo.pSliceInLayer[uiSliceIdx].iCountMbNumInSlice,
pSlice[uiSliceIdx].iCountMbNumInSlice,
INT_MULTIPLY);
pSliceIdx->sSlicingOverRc.iFrameBitsSlice = 0;
pSliceIdx->sSlicingOverRc.iGomBitsSlice = 0;