PVS-StudioWarnings

PVS-Studio warning V557 for FFMpeg

Nov 13th, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. void ff_mjpeg_encode_mb(MpegEncContext *s,
  2.                         int16_t block[6][64])
  3. {
  4.     int i;
  5.     if (s->chroma_format == CHROMA_444) {
  6.         encode_block(s, block[0], 0);
  7.         encode_block(s, block[2], 2);
  8.         encode_block(s, block[4], 4);
  9.         encode_block(s, block[8], 8);
  10.         encode_block(s, block[5], 5);
  11.         encode_block(s, block[9], 9);
  12.   ....
  13. }
  14.  
  15. This suspicious code was found in FFMpeg project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V557 Array overrun is possible. The '8' index is pointing beyond array bound. mjpegenc.c 497
  18.  
  19. 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