PVS-StudioWarnings

PVS-Studio warning V557 for IPP Samples

Nov 13th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. typedef Ipp32f samplefbout[2][18][32];
  2. samplefbout fbout_data[NUM_CHANNELS];
  3.  
  4. static void mp3enc_join_LR_l2(MP3Enc *state)
  5. {
  6.   Ipp32s sb, j;
  7.   Ipp32s sblimit_real = state->com.sblimit_real;
  8.  
  9.   for (sb = 0; sb < sblimit_real; sb++)
  10.     for (j = 0; j < 36; j++)
  11.       state->fbout_data[2][0][j][sb] =
  12.         0.5f * (state->fbout_data[0][0][j][sb] +
  13.         state->fbout_data[1][0][j][sb]);
  14. }
  15.  
  16. This suspicious code was found in IPP Samples project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V557 Array overrun is possible. The value of 'j' index could reach 35. mp3_enc mp3enc_quantization_12_fp.c 639
  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