PVS-StudioWarnings

PVS-Studio warning V595 for QT

Nov 11th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. static int gray_raster_render(....)
  2. {
  3.   const QT_FT_Outline* outline =
  4.     (const QT_FT_Outline*)params->source;
  5.  
  6.   ....
  7.  
  8.   /* return immediately if the outline is empty */
  9.   if ( outline->n_points == 0 || outline->n_contours <= 0 )
  10.     return 0;
  11.  
  12.   if ( !outline || !outline->contours || !outline->points )
  13.     return ErrRaster_Invalid_Outline;
  14.  
  15.   ....
  16. }
  17.  
  18. Optimization too early.
  19.  
  20.  
  21. This suspicious code was found in QT project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V595 The 'outline' pointer was utilized before it was verified against nullptr. Check lines: 1746, 1749. qgrayraster.c 1746
  24.  
  25. 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