PVS-StudioWarnings

PVS-Studio warning V501 for FFMpeg

Nov 19th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.02 KB | None | 0 0
  1. static int init_muxer(AVFormatContext *s, AVDictionary **options)
  2. {
  3.   ....
  4.   if (st->sample_aspect_ratio.num != 0 &&
  5.     st->sample_aspect_ratio.den != 0 &&
  6.     codec->sample_aspect_ratio.den != 0 &&
  7.     codec->sample_aspect_ratio.den != 0) {
  8.       av_log(s, AV_LOG_ERROR,
  9.              "Aspect ratio mismatch between muxer "
  10.              "(%d/%d) and encoder layer (%d/%d)\n",
  11.              st->sample_aspect_ratio.num,
  12.              st->sample_aspect_ratio.den,
  13.              codec->sample_aspect_ratio.num,
  14.              codec->sample_aspect_ratio.den);
  15.       ret = AVERROR(EINVAL);
  16.       goto fail;
  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 'codec->sample_aspect_ratio.den != 0' to the left and to the right of the '&&' operator. mux.c 277
  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