Professional Documents
Culture Documents
, . ,
Code Samples for the Intel Integrated Performance Primitives (Intel IPP) Library Intel Integrated Performance Primitives Library 7.0 Samples for Parallel Studio 2011 :
y y y y
IPP Samples for Windows IPP UIC Demo for Windows IPP DMIP Samples for Windows IPP Cryptography Samples for Windows , IPP Samples for Windows. , PVS-
Studio
" Copy-Paste
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; } ... }
PVS-Studio: V557 Array overrun is possible. The '30' index is pointing beyond array bound. avs_enc umc_avs_enc_compressor_enc_b.cpp 495 . . 30 3, 0. .
,
AACStatus aacencGetFrame(...) { ... if (maxEn[0] > maxEn[1]) {
ics[1].num_window_groups = ics[0].num_window_groups; for (g = 0; g < ics[0].num_window_groups; g++) { ics[1].len_window_group[g] = ics[0]. len_window_group[g]; } } else { ics[1].num_window_groups = ics[0].num_window_groups; for (g = 0; g < ics[0].num_window_groups; g++) { ics[1].len_window_group[g] = ics[0].len_window_group[g]; } } ... }
PVS-Studio: V523 The 'then' statement is equivalent to the 'else' statement. aac_enc aac_enc_api_fp.c 1379 , "if" , . .
"--" "*"
static void sbrencConflictResolution (..., Ipp32s *nLeftBord) { ... *nLeftBord = nBordNext - 1; ... if (*lenBordNext > 1) { ... *nLeftBord--; } ... }
PVS-Studio: V532 Consider inspecting the statement of '*pointer--' pattern. Probably meant: '(*pointer)--'. aac_enc sbr_enc_frame_gen.c 428 "nLeftBord" "sbrencConflictResolution". "nBordNext - 1". . :
*nLeftBord--;
, :
(*nLeftBord)--;
"++" "*"
. . , . , ,
static IppStatus mp2_HuffmanTableInitAlloc (Ipp32s *tbl, ...) { ... for (i = 0; i < num_tbl; i++) {
*tbl++; } ... }
PVS-Studio: V532 Consider inspecting the statement of '*pointer++' pattern. Probably meant: '(*pointer)++'. mpeg2_dec umc_mpeg2_dec.cpp 59 ,
tbl += num_tbl;
PVS-Studio "(*tbl)++;".
*tbl += num_tbl;
, .
, :
, .
,
"GetTrackByPidOrCreateNew", .
typedef signed int typedef unsigned int Ipp32s; Ipp32u;
"-1" ,
Ipp32s StreamParser::GetTrackByPidOrCreateNew( Ipp32s iPid, bool *pIsNew) { ... else if (!pIsNew || m_uiTracks >= MAX_TRACK) return -1; ... }
"GetTrackByPidOrCreateNew" :
if (*pTrack >= 0 && TRACK_LPCM == m_pInfo[*pTrack] ->m_Type) ippsSwapBytes_16u_I((Ipp16u *)pData ->GetDataPointer(), m_pPacket->uiSize / 2); ... }
PVS-Studio: V547 Expression '* pTrack >= 0' is always true. Unsigned type value is always >= 0. demuxer umc_stream_parser.cpp 179 , (unsigned int). . , Violation "GetTrackByPidOrCreateNew" "-1" "4294967295",
"-1",
Access
Copy-Paste
{ ...
+1
void H264SegmentDecoder::ResetDeblockingVariablesMBAFF()
if (GetMBFieldDecodingFlag(m_gmbinfo ->mbs[m_CurMBAddr - mb_width * 2])) m_deblockingParams.nNeighbour[HORIZONTAL_DEBLOCKING] = m_CurMBAddr - mb_width * 2; else m_deblockingParams.nNeighbour[HORIZONTAL_DEBLOCKING] = m_CurMBAddr - mb_width * 2; ... }
PVS-Studio: V523 The 'then' statement is equivalent to the 'else' statement. h264_dec umc_h264_segment_decoder_deblocking_mbaff.cpp 340 , . , :
if (GetMBFieldDecodingFlag (m_gmbinfo->mbs[m_CurMBAddr - mb_width * 2])) m_deblockingParams.nNeighbour[HORIZONTAL_DEBLOCKING] = m_CurMBAddr - mb_width * 2; else m_deblockingParams.nNeighbour[HORIZONTAL_DEBLOCKING] = m_CurMBAddr - mb_width * 2 + 1;
"H264CoreEncoder_ResetDeblockingVariablesMBAFF" "+ 1". PVS-Studio: V523 The 'then' statement is equivalent to the 'else' statement. h264_enc umc_h264_deblocking_mbaff_tmpl.cpp.h 366
Remove,
void H264ThreadGroup::RemoveThread(H264Thread * thread) { AutomaticUMCMutex guard(m_mGuard); std::remove(m_threads.begin(), m_threads.end(), thread); }
PVS-Studio: V530 The return value of function 'remove' is required to be utilized. h264_dec umc_h264_thread.cpp 226 . std::remove :
m_threads .erase( std::remove(m_threads.begin(), m_threads.end(), thread), m_threads.end());
, .
. , ,
mutex, , .
, . , . -
H264
{ if ((p_newHeader.frame_num != m_lastSlice.frame_num) || (p_newHeader.pic_parameter_set_id != p_newHeader.pic_parameter_set_id) || (p_newHeader.field_pic_flag != p_newHeader.field_pic_flag) || (p_newHeader.bottom_field_flag != m_lastSlice.bottom_field_flag) ){ return false; } ... }
PVS-Studio: V501 There are identical sub-expressions 'p_newHeader.pic_parameter_set_id' to the left and to the right of the '!=' operator. h264_spl umc_h264_au_stream.cpp 478 V501 There are identical sub-expressions 'p_newHeader.field_pic_flag' to the left and to the right of the '!=' operator. h264_spl umc_h264_au_stream.cpp 479
, :
(p_newHeader.pic_parameter_set_id != m_lastSlice.pic_parameter_set_id) (p_newHeader.field_pic_flag != m_lastSlice.field_pic_flag)
, :
Ipp32s ippVideoEncoderMPEG4::Init(mp4_Param *par) { ... VOL.sprite_width = par ->sprite_width; VOL.sprite_height = par ->sprite_height;
... }
PVS-Studio: V537 Consider reviewing the correctness of 'sprite_left_coordinate' item's usage. mpeg4_enc mp4_enc_misc.cpp 387 "VOL.sprite_top_coordinate" : .
JERRCODE CJPEGDecoder::DecodeScanBaselineNI(void) { ... for(c = 0; c < m_scan_ncomps; c++) { block = m_block_buffer + (DCTSIZE2*m_nblock*(j+(i*m_numxMCU)));
// skip any relevant components for(c = 0; c < m_ccomp[ m_curr_comp_no].m_comp_no; c++) { block += (DCTSIZE2*m_ccomp[c].m_nblocks); } ... }
PVS-Studio: V535 The variable 'c' is being used for this loop and for the outer loop. jpegcodec jpegdec.cpp 4652 , , 'c'. .
PVS-Studio: V519 The 'MaxBrefPOC' object is assigned values twice successively. Perhaps this is a mistake. h264_enc umc_h264_enc_cpb_tmpl.cpp.h 784 , , , ! , . GOTO ? :
,
AACStatus sbrencResampler_v2_32f(Ipp32f* pSrc, Ipp32f* pDst) { ... k = nCoef-1; k = nCoef; ... }
PVS-Studio: V519 The 'k' object is assigned values twice successively. Perhaps this is a mistake. aac_enc sbr_enc_resampler_fp.c 90 , , "nCoef". , . . " , , , ". . "nCoef-1",
,
void MeBase::MakeVlcTableDecision() { ...
PVS-Studio: V501 There are identical sub-expressions to the left and to the right of the '<' operator: (m_cur.AcRate [2]) < (m_cur.AcRate [2]) me umc_me.cpp 898 . :
Ipp32s BestAC= IPP_MIN(IPP_MIN(m_cur.AcRate[0],m_cur.AcRate[1]), IPP_MIN(m_cur.AcRate[2],m_cur.AcRate[3]));
3,
2.
, , ,
"
". "m_cur.AcRate[3]". .
,
:
Ipp32s ippVideoEncoderMPEG4::Init(mp4_Param *par) { ... i = IPP_MAX(mBVOPsearchHorBack, mBVOPsearchHorBack); ... }
PVS-Studio: V501 There are identical sub-expressions '(mBVOPsearchHorBack)' to the left and to the right of the '>' operator. mpeg4_enc mp4_enc_misc.cpp 547 mBVOPsearchHorBack. mBVOPsearchHorBack mBVOPsearchVerBack:
i = IPP_MAX(mBVOPsearchHorBack, mBVOPsearchVerBack);
PVS-Studio: V557 Array overrun is possible. The '3' index is pointing beyond array bound. mp3_enc mp3enc_psychoacoustic_fp.c 726 . , . '3' '2'. ,
,
void lNormalizeVector _32f_P3IM(Ipp32f *vec[3], Ipp32s* mask, Ipp32s len) { Ipp32s Ipp32f i; norm;
PVS-Studio: V503 This is a nonsensical comparison: pointer < 0. ipprsample ippr_sample.cpp 501 , , . "mask" . , . . " if(mask<0)".
"i". , , , :
if(mask[i]<0) continue;
0
int ec_fb_GetSubbandNum(void *stat) { _fbECState *state=(_fbECState *)stat; return (state->freq-state->freq); }
PVS-Studio: V501 There are identical sub-expressions to the left and to the right of the '-' operator: state->freq - state->freq speech ec_fb.c 250 . , . 0. -
Ipp32u;
UMC::Status Init(..., Ipp32u memSize, ...) { ... memSize -= UMC::align_value<Ipp32u>(m_nFrames*sizeof(Frame)); if(memSize < 0) return UMC::UMC_ERR_NOT_ENOUGH_BUFFER;
... }
PVS-Studio: V547 Expression 'memSize < 0' is always false. Unsigned type value is never < 0. vc1_enc umc_vc1_enc_planes.h 200 , , "memSize" , , "unsigned int". , . , 10. , . . . , , . . "memSize < 0"
Ipp32u m_iCurrMBIndex; VC1EncoderMBInfo* VC1EncoderMBs::GetPevMBInfo(Ipp32s x, Ip p32s y) { Ipp32s row = (y>0)? m_iPrevRowIndex:m_iCurrRowIndex; return ((m_iCurrMBIndex - x <0 || row <0)? 0 : &m_MBInfo[row][m_iCurrMBIndex - x]); }
PVS-Studio: V547 Expression 'm_iCurrMBIndex - x < 0' is always false. Unsigned type value is never < 0. vc1_enc umc_vc1_enc_mb.cpp 188 "m_iCurrMBIndex" "unsigned". . "m_iCurrMBIndex" "m_iCurrMBIndex - x" "m_iCurrMBIndex - x < 0" "unsigned". "m_iCurrMBIndex - x" , "m_iCurrMBIndex - x < 0" .
5,
"x"
10.
"m_MBInfo[row][0xFFFFFFFBu]"
'?:'.
, ++ . . , .
vm_file* vm_file_fopen(...)
PVS-Studio: V502 Perhaps the '?:' operator works in a different way than it was expected. The '?:' operator has a lower priority than the '|' operator. vm vm_file_win.c 393 FILE_ATTRIBUTE_NORMAL "mds[3]" "|" , ( "?:". ):
0.
"mds[3]"
AACStatus alsdecGetFrame (...) { ... for (i = 0; i < num; i++) { ... *tmpPtr = (Ipp32s)((tmp << 24) + ((tmp & 0xff00) << 8) + ((tmp >> 8) & 0xff00) + (tmp >> 24)); *tmpPtr = *srcPrt; ... } ...
PVS-Studio: V519 The '* tmpPtr' object is assigned values twice successively. Perhaps this is a mistake. aac_dec als_dec_api.c 928 . -" ".
static IPLStatus ownRemap8u_Pixel(...) { ... saveXMask saveXMask saveYMask saveYMask ... } = xMap ->maskROI; = NULL; = yMap ->maskROI; = NULL;
PVS-Studio: V519 The 'saveXMask' object is assigned values twice successively. Perhaps this is a mistake. ipl iplremap.c 36 V519 The 'saveYMask' object is assigned values twice successively. Perhaps this is a mistake. ipl iplremap.c 38 . 8 ! :
Ipp32s ippVideoEncoderMPEG4::Init(mp4_Param *par) { ... mNumOfFrames = par ->NumOfFrames; mNumOfFrames = -1; ... }
PVS-Studio: V519 The 'mNumOfFrames' object is assigned values twice successively. Perhaps this is a mistake. mpeg4_enc mp4_enc_misc.cpp 276
, , , . . . , , assert(), .
. Copy-Paste , . ,