PVS-StudioWarnings

PVS-Studio warning V522 for ffdshow

Nov 21st, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. STDMETHODIMP_(bool) TffdshowDecAudioInputPin::getsf(
  2.   TsampleFormat &outsf)
  3. {
  4.   if (!audio)                                      <<<---
  5.   {
  6.     .... // audio don't used
  7.     } else if (bitstream_codec(audio->codecId)) {  <<<---
  8.       outsf.sf = TsampleFormat::getSampleFormat(codecId);
  9.       outsf.alternateSF = filter->insf.alternateSF;
  10.       return true;
  11.     }
  12.   } else {
  13.   .....
  14. }
  15.  
  16. This suspicious code was found in ffdshow project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V522 Dereferencing of the null pointer 'audio' might take place. tffdshowdecaudioinputpin.cpp 468
  19.  
  20. 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