Advertisement
PVS-StudioWarnings

PVS-Studio warning V557 for IPP Samples

Nov 25th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. typedef struct
  2. {
  3.   ...
  4.   VM_ALIGN16_DECL(Ipp32f)
  5.     nb_short[2][3][__ALIGNED(MAX_PPT_SHORT)];
  6.   ...
  7. } mpaPsychoacousticBlock;
  8.  
  9. static void mp3encPsy_short_window(....)
  10. {
  11.   ...
  12.   if (win_counter == 0) {
  13.     nb_s = pBlock->nb_short[0][3];
  14.   }
  15.   ...
  16. }
  17.  
  18. This is what should have been written here: 2.
  19.  
  20. This suspicious code was found in IPP Samples project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V557 Array overrun is possible. The '3' index is pointing beyond array bound. mp3_enc mp3enc_psychoacoustic_fp.c 726
  23.  
  24. 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