diff --git a/media_softlet/agnostic/common/codec/hal/enc/avc/features/encode_avc_vdenc_preenc.cpp b/media_softlet/agnostic/common/codec/hal/enc/avc/features/encode_avc_vdenc_preenc.cpp index 9f00568ff24..99247dc98c4 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/avc/features/encode_avc_vdenc_preenc.cpp +++ b/media_softlet/agnostic/common/codec/hal/enc/avc/features/encode_avc_vdenc_preenc.cpp @@ -152,7 +152,7 @@ MOS_STATUS AvcVdencPreEnc::PreparePreEncConfig(void *params) uint8_t depth = 0; uint32_t poc = 0; - if (m_preEncConfig.GopRefDist = 0) + if (m_preEncConfig.GopRefDist == 0) { return MOS_STATUS_INVALID_PARAMETER; } diff --git a/media_softlet/agnostic/common/codec/hal/enc/jpeg/packet/encode_jpeg_packet.cpp b/media_softlet/agnostic/common/codec/hal/enc/jpeg/packet/encode_jpeg_packet.cpp index 681e86c8d4b..f9e2f781bc2 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/jpeg/packet/encode_jpeg_packet.cpp +++ b/media_softlet/agnostic/common/codec/hal/enc/jpeg/packet/encode_jpeg_packet.cpp @@ -687,13 +687,13 @@ namespace encode { // Copy over huffman data to the other two data buffers for JPEG picture header for (uint32_t i = 0; i < m_numHuffBuffers; i++) { - m_jpegHuffmanTable->m_huffmanData[i + 2].m_tableClass = m_jpegHuffmanTable->m_huffmanData[i].m_tableClass; - m_jpegHuffmanTable->m_huffmanData[i + 2].m_tableID = m_jpegHuffmanTable->m_huffmanData[i].m_tableID; - if ((i + 2) >= JPEG_NUM_ENCODE_HUFF_BUFF) { return MOS_STATUS_INVALID_PARAMETER; } + m_jpegHuffmanTable->m_huffmanData[i + 2].m_tableClass = m_jpegHuffmanTable->m_huffmanData[i].m_tableClass; + m_jpegHuffmanTable->m_huffmanData[i + 2].m_tableID = m_jpegHuffmanTable->m_huffmanData[i].m_tableID; + ENCODE_CHK_STATUS_RETURN(MOS_SecureMemcpy(&m_jpegHuffmanTable->m_huffmanData[i + 2].m_bits[0], sizeof(uint8_t) * JPEG_NUM_HUFF_TABLE_AC_BITS, &m_jpegHuffmanTable->m_huffmanData[i].m_bits[0],