Skip to content
This repository was archived by the owner on May 17, 2023. It is now read-only.

Commit 6691cbd

Browse files
chuanli1dmitryermilov
authored andcommitted
[Decode] sampling factor check code refactor
Issue: MDP-68553 Test: manual
1 parent 0b69101 commit 6691cbd

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

_studio/shared/umc/codec/jpeg_dec/src/jpegdec.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3051,8 +3051,6 @@ JERRCODE CJPEGDecoder::ReconstructMCURowEX(int16_t* pMCUBuf,
30513051
{
30523052
dst += l*8;
30533053

3054-
if((uint8_t*)dst > curr_comp->GetSSBufferPtr(thread_id)+curr_comp->m_ss_bufsize-1)
3055-
return JPEG_ERR_BUFF;
30563054
status = mfxiDCTQuantInv8x8LS_JPEG_16s16u_C1R(
30573055
pMCUBuf,dst,dstStep,qtbl);
30583056
if(ippStsNoErr > status)

_studio/shared/umc/codec/jpeg_dec/src/jpegdec_base.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,8 @@ JERRCODE CJPEGDecoderBase::ParseSOF0(void)
914914
if(JPEG_OK != jerr)
915915
return jerr;
916916

917-
if(curr_comp->m_hsampling <= 0 || curr_comp->m_vsampling <= 0 || curr_comp->m_q_selector >= MAX_QUANT_TABLES)
917+
if(curr_comp->m_hsampling <= 0 || curr_comp->m_hsampling > 4 ||
918+
curr_comp->m_vsampling <= 0 || curr_comp->m_vsampling > 4 || curr_comp->m_q_selector >= MAX_QUANT_TABLES)
918919
{
919920
return JPEG_ERR_SOF_DATA;
920921
}

0 commit comments

Comments
 (0)