Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 6 files). Show all
Unified · Split
| @@ -485,10 +485,10 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 484 unmodified lines | |||
| 485 | int32_t iMbNumInFrame = 0; | 485 | int32_t iMbNumInFrame = 0; |
| 486 | uint32_t iMaxSliceNum = MAX_SLICES_NUM; | 486 | uint32_t iMaxSliceNum = MAX_SLICES_NUM; |
| 487 | int32_t iReturn = 0; | 487 | int32_t iReturn = 0; |
| 488 | if ((kiPicWidth <= 0) || (kiPicHeight <= 0) || (kiPicWidth > MAX_WIDTH) || (kiPicHeight > MAX_HEIGHT)) { | 488 | if ((kiPicWidth <= 0) || (kiPicHeight <= 0) || (kiPicWidth * kiPicHeight > (MAX_MBS_PER_FRAME << 8))) { |
| 489 | WelsLog (pLogCtx, WELS_LOG_ERROR, | 489 | WelsLog (pLogCtx, WELS_LOG_ERROR, |
| 490 | "ParamValidationExt(),width(1-%d),height(1-%d)invalid %d x %d in dependency layer settings!", MAX_WIDTH, MAX_HEIGHT, | 490 | "ParamValidationExt(), width > 0, height > 0, width * height <= %d, invalid %d x %d in dependency layer settings!", |
| 491 | kiPicWidth, kiPicHeight); | 491 | (MAX_MBS_PER_FRAME << 8), kiPicWidth, kiPicHeight); |
| 492 | return ENC_RETURN_UNSUPPORTED_PARA; | 492 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 493 | } | 493 | } |
| 494 | if ((kiPicWidth & 0x0F) != 0 || (kiPicHeight & 0x0F) != 0) { | 494 | if ((kiPicWidth & 0x0F) != 0 || (kiPicHeight & 0x0F) != 0) { |