PVS-StudioWarnings

PVS-Studio warning V598 for IPP Samples

Nov 11th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. class _MediaDataEx {
  2.   ...
  3.   virtual bool TryStrongCasting(
  4.     pDynamicCastFunction pCandidateFunction) const;
  5.   virtual bool TryWeakCasting(
  6.     pDynamicCastFunction pCandidateFunction) const;
  7. };
  8.  
  9. Status VC1Splitter::Init(SplitterParams& rInit)
  10. {
  11.   MediaDataEx::_MediaDataEx *m_stCodes;
  12.   ...
  13.   m_stCodes = (MediaDataEx::_MediaDataEx *)
  14.     ippsMalloc_8u(START_CODE_NUMBER*2*sizeof(Ipp32s)+
  15.                   sizeof(MediaDataEx::_MediaDataEx));
  16.   ...
  17.   memset(m_stCodes, 0,
  18.     (START_CODE_NUMBER*2*sizeof(Ipp32s)+
  19.     sizeof(MediaDataEx::_MediaDataEx)));
  20.   ...
  21. }
  22.  
  23. This suspicious code was found in IPP Samples project by PVS-Studio static code analyzer.
  24. Warning message is:
  25. V598 The 'memset' function is used to nullify the fields of '_MediaDataEx' class. Virtual method table will be damaged by this. vc1_spl umc_vc1_spl.cpp 131
  26.  
  27. 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