Skip to content

Commit 2610ab1

Browse files
author
HaiboZhu
committed
Merge pull request #2174 from HaiboZhu/Bugfix_CHECK_SE_UPPER_conditions_v1.5
Fix the macro UPPER_CHECK conditions
2 parents 9e1f179 + 1072dee commit 2610ab1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

codec/decoder/core/src/decoder_core.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co
723723
pSliceHead->eSliceType = static_cast <EWelsSliceType> (uiSliceType);
724724

725725
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_parameter_set_id
726-
WELS_CHECK_SE_UPPER_ERROR (uiCode, MAX_PPS_COUNT, "iPpsId out of range", GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER,
726+
WELS_CHECK_SE_UPPER_ERROR (uiCode, (MAX_PPS_COUNT - 1), "iPpsId out of range", GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER,
727727
ERR_INFO_PPS_ID_OVERFLOW));
728728
iPpsId = uiCode;
729729

@@ -807,7 +807,7 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co
807807
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_NO_PARAM_SETS);
808808
}
809809
// check first_mb_in_slice
810-
WELS_CHECK_SE_UPPER_ERROR ((uint32_t) (pSliceHead->iFirstMbInSlice), pSps->uiTotalMbCount, "first_mb_in_slice",
810+
WELS_CHECK_SE_UPPER_ERROR ((uint32_t) (pSliceHead->iFirstMbInSlice), (pSps->uiTotalMbCount - 1), "first_mb_in_slice",
811811
GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_FIRST_MB_IN_SLICE));
812812
WELS_READ_VERIFY (BsGetBits (pBs, pSps->uiLog2MaxFrameNum, &uiCode)); //frame_num
813813
pSliceHead->iFrameNum = uiCode;

0 commit comments

Comments
 (0)