PVS-StudioWarnings

PVS-Studio warning V557 for LAME 3.xx

Nov 12th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. ...
  2. #define SBMAX_l       22
  3. ...
  4. int l[1+SBMAX_l];
  5. ...
  6.  
  7. inline static void
  8. recalc_divide_init(const lame_internal_flags * const gfc, ...)
  9. {
  10.   int r0, r1;
  11.   ...
  12.  
  13.   for (r0 = 0; r0 < 16; r0++) {
  14.     ...
  15.     for (r1 = 0; r1 < 8; r1++) {
  16.       int a2 = gfc->scalefac_band.l[r0 + r1 + 2];
  17.   ...
  18. }
  19.  
  20. This suspicious code was found in LAME 3.xx project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V557 Array overrun is possible. The value of 'r0 + r1 + 2' index could reach 24. libmp3lame takehiro.c 895
  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