Advertisement
PVS-StudioWarnings

PVS-Studio warning V557 for IPP Samples

Nov 27th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. typedef Ipp32f samplefbout[2][18][32];
  2. samplefbout fbout_data[NUM_CHANNELS];
  3.  
  4. static void mp3enc_scale_factor_calc_l2(MP3Enc *state)
  5. {
  6.   ...
  7.   for (ch = 0; ch < stereo + state->com.mc_channel; ch++) {
  8.     for (t = 0; t < 3; t++) {
  9.       for (sb = 0; sb < sblimit_real; sb++){
  10.         for (j = 0; j < 12; j++)
  11.           fbout[j] = state->fbout_data[ch][0][t * 12 + j][sb];
  12.   ...
  13. }
  14.  
  15. If it can be possible that t == 2, while j == 11, an array overrun will occur.
  16.  
  17.  
  18. This suspicious code was found in IPP Samples project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V557 Array overrun is possible. The value of 't * 12 + j' index could reach 35. mp3_enc mp3enc_quantization_12_fp.c 275
  21.  
  22. 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