Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 1 file). Show all
Unified · Split
| @@ -473,6 +473,7 @@ int32_t CheckSpsId (PWelsDecoderContext pCtx, PSubsetSps* ppSubsetSps, PSps* ppS · 472 unmodified lines | ||
| 473 | 473 | #define SLICE_HEADER_ALPHAC0_BETA_OFFSET_MAX 12 |
| 474 | 474 | #define SLICE_HEADER_INTER_LAYER_ALPHAC0_BETA_OFFSET_MIN -12 |
| 475 | 475 | #define SLICE_HEADER_INTER_LAYER_ALPHAC0_BETA_OFFSET_MAX 12 |
| 476 | +#define MAX_NUM_REF_IDX_L0_ACTIVE_MINUS1 15 | |
| 476 | 477 | /* |
| 477 | 478 | * decode_slice_header_avc |
| 478 | 479 | * Parse slice header of bitstream in avc for storing data structure |
| @@ -673,6 +674,8 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 194 unmodified lines | ||
| 673 | 674 | pSliceHead->bNumRefIdxActiveOverrideFlag = !!uiCode; |
| 674 | 675 | if (pSliceHead->bNumRefIdxActiveOverrideFlag) { |
| 675 | 676 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //num_ref_idx_l0_active_minus1 |
| 677 | + WELS_CHECK_SE_UPPER_ERROR (uiCode, MAX_NUM_REF_IDX_L0_ACTIVE_MINUS1, "num_ref_idx_l0_active_minus1", | |
| 678 | + GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_NUM_REF_IDX_L0_ACTIVE_MINUS1)); | |
| 676 | 679 | pSliceHead->uiRefCount[0] = 1 + uiCode; |
| 677 | 680 | } |
| 678 | 681 | } |