History

Remove UBSAN warnings about negative left shift

Haibo Zhu committed 11 years ago

Commit 03d16bb1 parent 3067d1212 files · +71 −71Browse files

Showing the changes to codec/decoder/core/src/error_concealment.cpp (1 of 12 files). Show all

Unified · Split

codec/decoder/core/src/error_concealment.cpp+10−10
@@ -224,23 +224,23 @@ void DoMbECMvCopy (PWelsDecoderContext pCtx, PPicture pDec, PPicture pRef, int32 · 223 unmodified lines
224224 iPicHeightBottomLimit = (pMCRefMem->iPicHeight - pCtx->sFrameCrop.iTopOffset * 2);
225225 }
226226 // further make sure no need to expand picture
227− int32_t iMinLeftOffset = (iPicWidthLeftLimit + 2) << 2;
228− int32_t iMaxRightOffset = ((iPicWidthRightLimit - 19) << 2);
229− int32_t iMinTopOffset = (iPicHeightTopLimit + 2) << 2;
230− int32_t iMaxBottomOffset = ((iPicHeightBottomLimit - 19) << 2);
227+ int32_t iMinLeftOffset = (iPicWidthLeftLimit + 2) * (1 << 2);
228+ int32_t iMaxRightOffset = ((iPicWidthRightLimit - 19) * (1 << 2));
229+ int32_t iMinTopOffset = (iPicHeightTopLimit + 2) * (1 << 2);
230+ int32_t iMaxBottomOffset = ((iPicHeightBottomLimit - 19) * (1 << 2));
231231 if (iFullMVx < iMinLeftOffset) {
232− iFullMVx = (iFullMVx >> 2) << 2;
232+ iFullMVx = (iFullMVx >> 2) * (1 << 2);
233233 iFullMVx = WELS_MAX (iPicWidthLeftLimit, iFullMVx);
234234 } else if (iFullMVx > iMaxRightOffset) {
235− iFullMVx = (iFullMVx >> 2) << 2;
236− iFullMVx = WELS_MIN (((iPicWidthRightLimit - 17) << 2), iFullMVx);
235+ iFullMVx = (iFullMVx >> 2) * (1 << 2);
236+ iFullMVx = WELS_MIN (((iPicWidthRightLimit - 17) * (1 << 2)), iFullMVx);
237237 }
238238 if (iFullMVy < iMinTopOffset) {
239− iFullMVy = (iFullMVy >> 2) << 2;
239+ iFullMVy = (iFullMVy >> 2) * (1 << 2);
240240 iFullMVy = WELS_MAX (iPicHeightTopLimit, iFullMVy);
241241 } else if (iFullMVy > iMaxBottomOffset) {
242− iFullMVy = (iFullMVy >> 2) << 2;
243− iFullMVy = WELS_MIN (((iPicHeightBottomLimit - 17) << 2), iFullMVy);
242+ iFullMVy = (iFullMVy >> 2) * (1 << 2);
243+ iFullMVy = WELS_MIN (((iPicHeightBottomLimit - 17) * (1 << 2)), iFullMVy);
244244 }
245245 iMVs[0] = iFullMVx - (iMbXInPix << 2);
246246 iMVs[1] = iFullMVy - (iMbYInPix << 2);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t