This makes for a chroma plane of 2x2. The SIMD versionf of generic downscalers assume that the width and height is at least 2, since it does an unconditional loop for the body of the image, and a separate step for the last pixel and last row. The SIMD versions assume that (width-1) and (height-1) are larger than zero. This is the same fix as in e8cdbd2ea7, but making sure it applies to both dimensions, that commit only fixed it for one of the dimensions. This fixes spurious crashes in EncodeDecodeTestAPI.SimulcastSVC.
Showing the changes to codec/encoder/core/src/wels_preprocess.cpp (1 of 1 file). Show all
Unified · Split
| @@ -429,11 +429,11 @@ bool JudgeNeedOfScaling (SWelsSvcCodingParam* pParam, Scaled_Picture* pScaledPic · 428 unmodified lines | ||
| 429 | 429 | int32_t iInputHeightXDstWidth = kiInputPicHeight * iCurDstWidth; |
| 430 | 430 | |
| 431 | 431 | if (iInputWidthXDstHeight > iInputHeightXDstWidth) { |
| 432 | − pScaledPicture->iScaledWidth[iSpatialIdx] = iCurDstWidth; | |
| 432 | + pScaledPicture->iScaledWidth[iSpatialIdx] = WELS_MAX (iCurDstWidth, 4); | |
| 433 | 433 | pScaledPicture->iScaledHeight[iSpatialIdx] = WELS_MAX (iInputHeightXDstWidth / kiInputPicWidth, 4); |
| 434 | 434 | } else { |
| 435 | 435 | pScaledPicture->iScaledWidth[iSpatialIdx] = WELS_MAX (iInputWidthXDstHeight / kiInputPicHeight, 4); |
| 436 | − pScaledPicture->iScaledHeight[iSpatialIdx] = iCurDstHeight; | |
| 436 | + pScaledPicture->iScaledHeight[iSpatialIdx] = WELS_MAX (iCurDstHeight, 4); | |
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | |