PVS-StudioWarnings

PVS-Studio warning V570 for OpenJPEG

Nov 12th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. OPJ_SIZE_T opj_stream_write_skip (
  2.   opj_stream_private_t * p_stream, ....)
  3. {
  4.   ....
  5.   if (!l_is_written)
  6.   {
  7.     p_stream->m_status |= opj_stream_e_error;
  8.     p_stream->m_bytes_in_buffer = 0;
  9.     p_stream->m_current_data = p_stream->m_current_data;
  10.     return (OPJ_SIZE_T) -1;
  11.   }
  12.   ....
  13. }
  14.  
  15. This suspicious code was found in OpenJPEG project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V570 The 'p_stream->m_current_data' variable is assigned to itself. cio.c 675
  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