Advertisement
PVS-StudioWarnings

PVS-Studio warning V501 for FFMpeg

Nov 26th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. int attribute_align_arg sws_scale(struct SwsContext *c,
  2.   const uint8_t * const srcSlice[],
  3.   const int srcStride[], int srcSliceY,
  4.   int srcSliceH, uint8_t *const dst[],
  5.   const int dstStride[])
  6. {
  7.   int i, ret;
  8.   const uint8_t *src2[4];
  9.   uint8_t *dst2[4];
  10.   uint8_t *rgb0_tmp = NULL;
  11.  
  12.   if (!srcSlice || !dstStride || !dst || !srcSlice) {
  13.     av_log(c, AV_LOG_ERROR,
  14.       "One of the input parameters to sws_scale() is NULL, "
  15.       "please check the calling code\n");
  16.     return 0;
  17.   }
  18.   ....
  19. }
  20.  
  21. This suspicious code was found in FFMpeg project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V501 There are identical sub-expressions '!srcSlice' to the left and to the right of the '||' operator. swscale.c 924
  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
Advertisement