Advertisement
PVS-StudioWarnings

PVS-Studio warning V517 for Chromium

Nov 21st, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.11 KB | None | 0 0
  1. WebRtc_Word32 ModuleFileUtility::UpdateWavHeader(OutStream& wav)
  2. {
  3.   ...
  4.   if(STR_CASE_CMP(codec_info_.plname, "L16") == 0)
  5.   {
  6.      res = WriteWavHeader(wav, codec_info_.plfreq, 2, channels,
  7.                          kWaveFormatPcm, _bytesWritten);
  8.   }
  9.   else if(STR_CASE_CMP(codec_info_.plname, "PCMU") == 0) <<<---
  10.   {
  11.      res = WriteWavHeader(wav, 8000, 1, channels,
  12.                           kWaveFormatMuLaw, _bytesWritten);
  13.   }
  14.   else if(STR_CASE_CMP(codec_info_.plname, "PCMU") == 0) <<<---
  15.   {
  16.      res = WriteWavHeader(wav, 8000, 1, channels,
  17.                           kWaveFormatALaw, _bytesWritten);
  18.   } else {
  19.     return 0;
  20.   }
  21.   return res;
  22. }
  23.  
  24. This suspicious code was found in Chromium project by PVS-Studio static code analyzer.
  25. Warning message is:
  26. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 1324, 1327. media_file media_file_utility.cc 1324
  27.  
  28. 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