Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct AVS_MB_INFO
- {
- ...
- Ipp8u refIdx[AVS_DIRECTIONS][4];
- ...
- };
- void AVSCompressor::GetRefIndiciesBSlice(void){
- ...
- if (m_pMbInfo->predType[0] & predType)
- {
- m_refIdx[iRefNum] = m_pMbInfo->refIdx[dir][0];
- iRefNum += 1;
- }
- if (m_pMbInfo->predType[1] & predType)
- {
- m_refIdx[iRefNum] = m_pMbInfo->refIdx[dir][1];
- iRefNum += 1;
- }
- if (m_pMbInfo->predType[2] & predType)
- {
- m_refIdx[iRefNum] = m_pMbInfo->refIdx[dir][2];
- iRefNum += 1;
- }
- if (m_pMbInfo->predType[3] & predType)
- {
- m_refIdx[iRefNum] = m_pMbInfo->refIdx[dir][30];
- iRefNum += 1;
- }
- ...
- }
- The programmer's hand faltered and now we have 30 instead of 3.
- This suspicious code was found in IPP Samples project by PVS-Studio static code analyzer.
- Warning message is:
- V557 Array overrun is possible. The '30' index is pointing beyond array bound. avs_enc umc_avs_enc_compressor_enc_b.cpp 495
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement