PVS-StudioWarnings

PVS-Studio warning V512 for IPP Samples

Nov 19th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. UMC::Status
  2. VC1EncoderADV::SetMEParams_I_Field(UMC::MeParams* MEParams)
  3. {
  4.   UMC::Status umcSts    UMC::UMC_OK;
  5.   memset(MEParams,0,sizeof(MEParams));
  6.   ...
  7. }
  8.  
  9. This is what should have been written here: memset(MEParams,0,sizeof(*MEParams));
  10.  
  11. This suspicious code was found in IPP Samples project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. V512 A call of the 'memset' function will lead to underflow of the buffer 'MEParams'. vc1_enc umc_vc1_enc_adv.cpp 1767
  14.  
  15. 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