Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler.
Number of rules (primarily dangerous function names) in C/C++ ruleset: 223
Examining data/libde265-1.0.7/enc265/image-io-png.cc
Examining data/libde265-1.0.7/enc265/image-io-png.h
Examining data/libde265-1.0.7/enc265/enc265.cc
Examining data/libde265-1.0.7/dec265/dec265.cc
Examining data/libde265-1.0.7/dec265/sdl.cc
Examining data/libde265-1.0.7/dec265/hdrcopy.cc
Examining data/libde265-1.0.7/acceleration-speed/acceleration-speed.h
Examining data/libde265-1.0.7/acceleration-speed/dct.cc
Examining data/libde265-1.0.7/acceleration-speed/acceleration-speed.cc
Examining data/libde265-1.0.7/acceleration-speed/dct-scalar.cc
Examining data/libde265-1.0.7/acceleration-speed/dct.h
Examining data/libde265-1.0.7/acceleration-speed/dct-sse.cc
Examining data/libde265-1.0.7/acceleration-speed/dct-scalar.h
Examining data/libde265-1.0.7/extra/getopt_long.c
Examining data/libde265-1.0.7/extra/win32cond.c
Examining data/libde265-1.0.7/extra/stdbool.h
Examining data/libde265-1.0.7/extra/getopt.h
Examining data/libde265-1.0.7/extra/win32cond.h
Examining data/libde265-1.0.7/extra/getopt.c
Examining data/libde265-1.0.7/extra/stdint.h
Examining data/libde265-1.0.7/libde265/dpb.cc
Examining data/libde265-1.0.7/libde265/sei.h
Examining data/libde265-1.0.7/libde265/contextmodel.h
Examining data/libde265-1.0.7/libde265/intrapred.cc
Examining data/libde265-1.0.7/libde265/md5.cc
Examining data/libde265-1.0.7/libde265/slice.h
Examining data/libde265-1.0.7/libde265/fallback.h
Examining data/libde265-1.0.7/libde265/intrapred.h
Examining data/libde265-1.0.7/libde265/nal.h
Examining data/libde265-1.0.7/libde265/refpic.h
Examining data/libde265-1.0.7/libde265/sps.h
Examining data/libde265-1.0.7/libde265/vui.cc
Examining data/libde265-1.0.7/libde265/refpic.cc
Examining data/libde265-1.0.7/libde265/scan.h
Examining data/libde265-1.0.7/libde265/alloc_pool.cc
Examining data/libde265-1.0.7/libde265/fallback-motion.h
Examining data/libde265-1.0.7/libde265/motion.h
Examining data/libde265-1.0.7/libde265/configparam.cc
Examining data/libde265-1.0.7/libde265/md5.h
Examining data/libde265-1.0.7/libde265/fallback.cc
Examining data/libde265-1.0.7/libde265/visualize.h
Examining data/libde265-1.0.7/libde265/motion.cc
Examining data/libde265-1.0.7/libde265/fallback-motion.cc
Examining data/libde265-1.0.7/libde265/transform.cc
Examining data/libde265-1.0.7/libde265/sao.h
Examining data/libde265-1.0.7/libde265/acceleration.h
Examining data/libde265-1.0.7/libde265/sao.cc
Examining data/libde265-1.0.7/libde265/x86/sse-dct.cc
Examining data/libde265-1.0.7/libde265/x86/sse.h
Examining data/libde265-1.0.7/libde265/x86/sse-motion.cc
Examining data/libde265-1.0.7/libde265/x86/sse-motion.h
Examining data/libde265-1.0.7/libde265/x86/sse.cc
Examining data/libde265-1.0.7/libde265/x86/sse-dct.h
Examining data/libde265-1.0.7/libde265/image.h
Examining data/libde265-1.0.7/libde265/nal-parser.h
Examining data/libde265-1.0.7/libde265/sei.cc
Examining data/libde265-1.0.7/libde265/de265.cc
Examining data/libde265-1.0.7/libde265/threads.cc
Examining data/libde265-1.0.7/libde265/decctx.h
Examining data/libde265-1.0.7/libde265/contextmodel.cc
Examining data/libde265-1.0.7/libde265/pps.h
Examining data/libde265-1.0.7/libde265/decctx.cc
Examining data/libde265-1.0.7/libde265/quality.cc
Examining data/libde265-1.0.7/libde265/threads.h
Examining data/libde265-1.0.7/libde265/deblock.cc
Examining data/libde265-1.0.7/libde265/deblock.h
Examining data/libde265-1.0.7/libde265/en265.cc
Examining data/libde265-1.0.7/libde265/dpb.h
Examining data/libde265-1.0.7/libde265/fallback-dct.cc
Examining data/libde265-1.0.7/libde265/alloc_pool.h
Examining data/libde265-1.0.7/libde265/scan.cc
Examining data/libde265-1.0.7/libde265/sps.cc
Examining data/libde265-1.0.7/libde265/bitstream.h
Examining data/libde265-1.0.7/libde265/de265-version.h
Examining data/libde265-1.0.7/libde265/vui.h
Examining data/libde265-1.0.7/libde265/util.h
Examining data/libde265-1.0.7/libde265/vps.h
Examining data/libde265-1.0.7/libde265/visualize.cc
Examining data/libde265-1.0.7/libde265/arm/arm.h
Examining data/libde265-1.0.7/libde265/arm/arm.cc
Examining data/libde265-1.0.7/libde265/en265.h
Examining data/libde265-1.0.7/libde265/vps.cc
Examining data/libde265-1.0.7/libde265/cabac.h
Examining data/libde265-1.0.7/libde265/fallback-dct.h
Examining data/libde265-1.0.7/libde265/encoder/sop.h
Examining data/libde265-1.0.7/libde265/encoder/encpicbuf.h
Examining data/libde265-1.0.7/libde265/encoder/encoder-params.cc
Examining data/libde265-1.0.7/libde265/encoder/encoder-motion.cc
Examining data/libde265-1.0.7/libde265/encoder/encoder-core.h
Examining data/libde265-1.0.7/libde265/encoder/encoder-types.cc
Examining data/libde265-1.0.7/libde265/encoder/sop.cc
Examining data/libde265-1.0.7/libde265/encoder/encoder-syntax.cc
Examining data/libde265-1.0.7/libde265/encoder/encoder-types.h
Examining data/libde265-1.0.7/libde265/encoder/encoder-syntax.h
Examining data/libde265-1.0.7/libde265/encoder/encoder-params.h
Examining data/libde265-1.0.7/libde265/encoder/encoder-intrapred.h
Examining data/libde265-1.0.7/libde265/encoder/encoder-context.cc
Examining data/libde265-1.0.7/libde265/encoder/encoder-core.cc
Examining data/libde265-1.0.7/libde265/encoder/encoder-context.h
Examining data/libde265-1.0.7/libde265/encoder/encoder-motion.h
Examining data/libde265-1.0.7/libde265/encoder/encoder-intrapred.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/tb-transform.h
Examining data/libde265-1.0.7/libde265/encoder/algo/cb-intra-inter.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/ctb-qscale.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/coding-options.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/cb-intra-inter.h
Examining data/libde265-1.0.7/libde265/encoder/algo/cb-skip.h
Examining data/libde265-1.0.7/libde265/encoder/algo/cb-intrapartmode.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/cb-interpartmode.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/tb-intrapredmode.h
Examining data/libde265-1.0.7/libde265/encoder/algo/tb-rateestim.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/cb-skip.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/pb-mv.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/tb-rateestim.h
Examining data/libde265-1.0.7/libde265/encoder/algo/tb-intrapredmode.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/tb-split.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/algo.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/algo.h
Examining data/libde265-1.0.7/libde265/encoder/algo/cb-mergeindex.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/cb-split.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/tb-split.h
Examining data/libde265-1.0.7/libde265/encoder/algo/ctb-qscale.h
Examining data/libde265-1.0.7/libde265/encoder/algo/pb-mv.h
Examining data/libde265-1.0.7/libde265/encoder/algo/tb-transform.cc
Examining data/libde265-1.0.7/libde265/encoder/algo/coding-options.h
Examining data/libde265-1.0.7/libde265/encoder/algo/cb-mergeindex.h
Examining data/libde265-1.0.7/libde265/encoder/algo/cb-split.h
Examining data/libde265-1.0.7/libde265/encoder/algo/cb-intrapartmode.h
Examining data/libde265-1.0.7/libde265/encoder/algo/cb-interpartmode.h
Examining data/libde265-1.0.7/libde265/encoder/encpicbuf.cc
Examining data/libde265-1.0.7/libde265/transform.h
Examining data/libde265-1.0.7/libde265/nal.cc
Examining data/libde265-1.0.7/libde265/bitstream.cc
Examining data/libde265-1.0.7/libde265/de265.h
Examining data/libde265-1.0.7/libde265/util.cc
Examining data/libde265-1.0.7/libde265/slice.cc
Examining data/libde265-1.0.7/libde265/pps.cc
Examining data/libde265-1.0.7/libde265/cabac.cc
Examining data/libde265-1.0.7/libde265/nal-parser.cc
Examining data/libde265-1.0.7/libde265/image-io.cc
Examining data/libde265-1.0.7/libde265/image-io.h
Examining data/libde265-1.0.7/libde265/configparam.h
Examining data/libde265-1.0.7/libde265/quality.h
Examining data/libde265-1.0.7/libde265/image.cc
Examining data/libde265-1.0.7/tools/rd-curves.cc
Examining data/libde265-1.0.7/tools/block-rate-estim.cc
Examining data/libde265-1.0.7/tools/tests.cc
Examining data/libde265-1.0.7/tools/yuv-distortion.cc
Examining data/libde265-1.0.7/tools/gen-entropy-table.cc
Examining data/libde265-1.0.7/tools/bjoentegaard.cc
Examining data/libde265-1.0.7/sherlock265/sherlock265.cc
Examining data/libde265-1.0.7/sherlock265/VideoWidget.cc
Examining data/libde265-1.0.7/sherlock265/VideoPlayer.cc
Examining data/libde265-1.0.7/sherlock265/VideoDecoder.cc

FINAL RESULTS:

data/libde265-1.0.7/enc265/image-io-png.cc:63:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
  sprintf(filename,mFilenameTemplate,mNextImageNumber);
data/libde265-1.0.7/libde265/configparam.cc:202:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(stringPtr, str.c_str());
data/libde265-1.0.7/libde265/encoder/algo/algo.cc:54:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, option, va);
data/libde265-1.0.7/libde265/encoder/algo/algo.cc:71:7:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
      vfprintf(stdout, fmt, va);
data/libde265-1.0.7/libde265/encoder/algo/algo.cc:90:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, option, va);
data/libde265-1.0.7/libde265/util.cc:89:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vfprintf(stdout, string + (noPrefix ? 1 : 0), va);
data/libde265-1.0.7/libde265/util.cc:107:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vfprintf(stdout, string + (noPrefix ? 1 : 0), va);
data/libde265-1.0.7/libde265/util.cc:125:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vfprintf(stdout, string + (noPrefix ? 1 : 0), va);
data/libde265-1.0.7/libde265/util.cc:161:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vfprintf(stdout, string + (noPrefix ? 1 : 0), va);
data/libde265-1.0.7/libde265/util.cc:174:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vfprintf(fh, string + (noPrefix ? 1 : 0), va);
data/libde265-1.0.7/tools/rd-curves.cc:377:16:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  int retval = system(replace_variables(sstr.str()).c_str());
data/libde265-1.0.7/tools/rd-curves.cc:399:16:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  int retval = system(replace_variables(sstr.str()).c_str());
data/libde265-1.0.7/tools/rd-curves.cc:557:16:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  int retval = system(cmd2.c_str());
data/libde265-1.0.7/tools/rd-curves.cc:618:20:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
  char *tempfile = mktemp(recoyuv_prefix);
data/libde265-1.0.7/tools/rd-curves.cc:634:16:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  int retval = system(cmd2.c_str());
data/libde265-1.0.7/tools/rd-curves.cc:706:16:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  int retval = system(cmd2.c_str());
data/libde265-1.0.7/tools/rd-curves.cc:768:16:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  int retval = system(cmd2.c_str());
data/libde265-1.0.7/tools/rd-curves.cc:854:16:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  int retval = system(cmd2.c_str());
data/libde265-1.0.7/tools/rd-curves.cc:858:20:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
  char *tempfile = mktemp(tmpyuv_prefix);
data/libde265-1.0.7/tools/rd-curves.cc:864:12:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  retval = system(cmd3.c_str());
data/libde265-1.0.7/tools/rd-curves.cc:932:16:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  int retval = system(cmd2.c_str());
data/libde265-1.0.7/tools/rd-curves.cc:936:20:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
  char *tempfile = mktemp(tmpyuv_prefix);
data/libde265-1.0.7/tools/rd-curves.cc:942:12:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  retval = system(cmd3.c_str());
data/libde265-1.0.7/acceleration-speed/acceleration-speed.cc:106:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    int c = getopt_long(argc, argv, "Hci:w:h:n:f:ter:", long_options, &option_index);
data/libde265-1.0.7/dec265/dec265.cc:566:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    int c = getopt_long(argc, argv, "qt:chf:o:dLB:n0vT:m:se"
data/libde265-1.0.7/enc265/enc265.cc:234:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    int c = getopt_long(argc, argv, "v"
data/libde265-1.0.7/extra/getopt.c:49:14:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
__weak_alias(getopt,_getopt);
data/libde265-1.0.7/extra/getopt.c:89:1:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
getopt(int nargc, char * nargv[], const char *ostr)
data/libde265-1.0.7/extra/getopt.h:58:5:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
int getopt(int, char**, char*);
data/libde265-1.0.7/extra/getopt.h:59:5:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
int getopt_long(int, char**, char*, struct option*, int*);
data/libde265-1.0.7/extra/getopt_long.c:156:1:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
getopt_long(int nargc, char ** nargv, char * options, struct option * long_options, int * index)
data/libde265-1.0.7/extra/win32cond.c:36:3:  [3] (misc) InitializeCriticalSection:
  Exceptions can be thrown in low-memory situations. Use
  InitializeCriticalSectionAndSpinCount instead.
  InitializeCriticalSection (&cv->waiters_count_lock_);
data/libde265-1.0.7/extra/win32cond.c:57:3:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
  EnterCriticalSection (&cv->waiters_count_lock_);
data/libde265-1.0.7/extra/win32cond.c:67:3:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
  EnterCriticalSection (&cv->waiters_count_lock_);
data/libde265-1.0.7/extra/win32cond.c:94:3:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
  EnterCriticalSection (&cv->waiters_count_lock_);
data/libde265-1.0.7/extra/win32cond.c:110:3:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
  EnterCriticalSection (&cv->waiters_count_lock_);
data/libde265-1.0.7/tools/bjoentegaard.cc:309:13:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while ((c=getopt(argc,argv, "l:h:")) != -1) {
data/libde265-1.0.7/tools/gen-entropy-table.cc:66:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(time(0));
data/libde265-1.0.7/tools/gen-entropy-table.cc:230:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(time(0));
data/libde265-1.0.7/tools/rd-curves.cc:1005:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    int c = getopt_long(argc, argv, "kf:p:",
data/libde265-1.0.7/acceleration-speed/acceleration-speed.cc:113:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    case 'w': img_width =atoi(optarg); break;
data/libde265-1.0.7/acceleration-speed/acceleration-speed.cc:114:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    case 'h': img_height=atoi(optarg); break;
data/libde265-1.0.7/acceleration-speed/acceleration-speed.cc:115:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    case 'n': nframes=atoi(optarg); break;
data/libde265-1.0.7/acceleration-speed/acceleration-speed.cc:120:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    case 'r': repeat=atoi(optarg); break;
data/libde265-1.0.7/dec265/dec265.cc:119:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      fh = fopen(output_filename, "wb");
data/libde265-1.0.7/dec265/dec265.cc:216:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(visu.AskFrame((BitmapChannel)ch)[y], data + y*stride, width);
data/libde265-1.0.7/dec265/dec265.cc:423:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(coded[y], data + y*stride, width);
data/libde265-1.0.7/dec265/dec265.cc:424:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(ref[y],   p    + y*stride, width);
data/libde265-1.0.7/dec265/dec265.cc:576:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    case 't': nThreads=atoi(optarg); break;
data/libde265-1.0.7/dec265/dec265.cc:578:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    case 'f': max_frames=atoi(optarg); break;
data/libde265-1.0.7/dec265/dec265.cc:590:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    case 'T': highestTID=atoi(optarg); break;
data/libde265-1.0.7/dec265/dec265.cc:668:22:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    reference_file = fopen(reference_filename, "rb");
data/libde265-1.0.7/dec265/dec265.cc:677:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fh = fopen(argv[optind], "rb");
data/libde265-1.0.7/dec265/dec265.cc:688:21:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    bytestream_fh = fopen(bytestream_filename, "wb");
data/libde265-1.0.7/dec265/hdrcopy.cc:97:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* fh = fopen(argv[1],"rb");
data/libde265-1.0.7/dec265/hdrcopy.cc:98:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char buf[1024];
data/libde265-1.0.7/dec265/hdrcopy.cc:119:8:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fh = fopen("out.bin","wb");
data/libde265-1.0.7/dec265/sdl.cc:136:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(mYUVOverlay->pixels[0], Y, rect.w * rect.h);
data/libde265-1.0.7/dec265/sdl.cc:137:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(mYUVOverlay->pixels[1], V, rect.w * rect.h / 4);
data/libde265-1.0.7/dec265/sdl.cc:138:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(mYUVOverlay->pixels[2], U, rect.w * rect.h / 4);
data/libde265-1.0.7/dec265/sdl.cc:145:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(mYUVOverlay->pixels[0]+y*rect.w, Y+stride*y, rect.w);
data/libde265-1.0.7/dec265/sdl.cc:150:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(mYUVOverlay->pixels[2]+y*rect.w/2, U+chroma_stride*y, rect.w/2);
data/libde265-1.0.7/dec265/sdl.cc:151:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(mYUVOverlay->pixels[1]+y*rect.w/2, V+chroma_stride*y, rect.w/2);
data/libde265-1.0.7/dec265/sdl.cc:163:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(mYUVOverlay->pixels[0], Y, rect.w * rect.h);
data/libde265-1.0.7/dec265/sdl.cc:170:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(mYUVOverlay->pixels[0]+y*rect.w, Y+stride*y, rect.w);
data/libde265-1.0.7/dec265/sdl.cc:238:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(p, Y+y*stride, rect.w);
data/libde265-1.0.7/enc265/enc265.cc:61:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(img.AskFrameY()[y], input->get_image_plane_at_pos(0,0,y), w);
data/libde265-1.0.7/enc265/enc265.cc:64:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(img.AskFrameU()[y], input->get_image_plane_at_pos(1,0,y), w/2);
data/libde265-1.0.7/enc265/enc265.cc:65:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(img.AskFrameV()[y], input->get_image_plane_at_pos(2,0,y), w/2);
data/libde265-1.0.7/enc265/image-io-png.cc:62:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char filename[1000];
data/libde265-1.0.7/enc265/image-io-png.cc:101:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(p, input.AskFrame((BitmapChannel(c)))[y], mWidth);
data/libde265-1.0.7/libde265/configparam.cc:97:11:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  int v = atoi(argv[idx]);
data/libde265-1.0.7/libde265/contextmodel.cc:106:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(model,oldModel,sizeof(context_model)*CONTEXT_MODEL_TABLE_LENGTH);
data/libde265-1.0.7/libde265/deblock.cc:907:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[100];
data/libde265-1.0.7/libde265/deblock.cc:908:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(buf,"deblock-%d",ctb_y);
data/libde265-1.0.7/libde265/deblock.cc:1038:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char buf[1000];
data/libde265-1.0.7/libde265/deblock.cc:1039:7:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
      sprintf(buf,"lf-after-V-%05d.yuv", ctx->img->PicOrderCntVal);
data/libde265-1.0.7/libde265/deblock.cc:1054:7:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
      sprintf(buf,"lf-after-H-%05d.yuv", ctx->img->PicOrderCntVal);
data/libde265-1.0.7/libde265/decctx.cc:1736:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char isLongTerm[2][3*MAX_NUM_REF_PICS];
data/libde265-1.0.7/libde265/decctx.cc:1874:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[1000];
data/libde265-1.0.7/libde265/decctx.cc:1875:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(buf,"pre-lf-%05d.yuv", img->PicOrderCntVal);
data/libde265-1.0.7/libde265/decctx.cc:1884:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(buf,"pre-sao-%05d.yuv", img->PicOrderCntVal);
data/libde265-1.0.7/libde265/decctx.cc:1893:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(buf,"sao-%05d.yuv", img->PicOrderCntVal);
data/libde265-1.0.7/libde265/encoder/encoder-context.cc:98:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(data, cabac_encoder.data(), cabac_encoder.size());
data/libde265-1.0.7/libde265/encoder/encoder-types.cc:752:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, mBase+mXMin+(y+mYMin)*mStride, mWidth);
data/libde265-1.0.7/libde265/encoder/encoder-types.cc:763:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(mBase+mXMin+(y+mYMin)*mStride, p, mWidth);
data/libde265-1.0.7/libde265/encoder/encoder-types.h:51:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(b.mBuf, mBuf, mBytesPerRow*mHeight);
data/libde265-1.0.7/libde265/image-io.cc:51:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  mFH = fopen(filename,"rb");
data/libde265-1.0.7/libde265/image-io.cc:147:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  mFH = fopen(filename,"wb");
data/libde265-1.0.7/libde265/image-io.cc:201:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  mFH = fopen(filename,"wb");
data/libde265-1.0.7/libde265/image.cc:87:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(p, inputdata, stride*height);
data/libde265-1.0.7/libde265/image.cc:91:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p+y*stride, ((char*)inputdata) + inputstride*y, inputstride);
data/libde265-1.0.7/libde265/image.cc:568:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(pixels[0]      + first*stride * luma_bpp,
data/libde265-1.0.7/libde265/image.cc:574:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(pixels[0]+yp*stride * luma_bpp,
data/libde265-1.0.7/libde265/image.cc:585:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(pixels[1]      + first_chroma*chroma_stride * chroma_bpp,
data/libde265-1.0.7/libde265/image.cc:588:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(pixels[2]      + first_chroma*chroma_stride * chroma_bpp,
data/libde265-1.0.7/libde265/image.cc:594:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(pixels[1]+y*chroma_stride * chroma_bpp,
data/libde265-1.0.7/libde265/image.cc:597:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(pixels[2]+y*chroma_stride * chroma_bpp,
data/libde265-1.0.7/libde265/image.h:781:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(sao,
data/libde265-1.0.7/libde265/intrapred.h:249:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p-2*nT, pF-2*nT, (4*nT+1) * sizeof(pixel_t));
data/libde265-1.0.7/libde265/md5.cc:226:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
			memcpy(&ctx->buffer[used], data, size);
data/libde265-1.0.7/libde265/md5.cc:230:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(&ctx->buffer[used], data, free);
data/libde265-1.0.7/libde265/md5.cc:241:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(ctx->buffer, data, size);
data/libde265-1.0.7/libde265/md5.h:37:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	unsigned char buffer[64];
data/libde265-1.0.7/libde265/nal-parser.cc:70:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(newbuffer, nal_data, data_size);
data/libde265-1.0.7/libde265/nal-parser.cc:85:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(nal_data + data_size, in_data, n);
data/libde265-1.0.7/libde265/nal-parser.cc:95:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(nal_data, in_data, n);
data/libde265-1.0.7/libde265/pps.cc:481:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&scaling_list, &sps->scaling_list, sizeof(scaling_list_data));
data/libde265-1.0.7/libde265/sao.cc:350:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(inputCopy, img->get_image_plane(cIdx), stride * height * img->get_bytes_per_pixel(cIdx));
data/libde265-1.0.7/libde265/sao.cc:395:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[100];
data/libde265-1.0.7/libde265/sao.cc:396:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(buf,"sao-%d",ctb_y);
data/libde265-1.0.7/libde265/slice.cc:4894:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[100];
data/libde265-1.0.7/libde265/slice.cc:4895:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
  sprintf(buf,"ctb-row-%d",debug_startCtbRow);
data/libde265-1.0.7/libde265/slice.cc:4901:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[100];
data/libde265-1.0.7/libde265/slice.cc:4902:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
  sprintf(buf,"slice-segment-%d;%d",debug_startCtbX,debug_startCtbY);
data/libde265-1.0.7/libde265/slice.h:171:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char    used_by_curr_pic_lt_flag[MAX_NUM_REF_PICS];
data/libde265-1.0.7/libde265/slice.h:173:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char delta_poc_msb_present_flag[MAX_NUM_REF_PICS];
data/libde265-1.0.7/libde265/slice.h:255:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char LongTermRefPic[2][MAX_NUM_REF_PICS]; /* Flag whether the picture at this ref-pic-list
data/libde265-1.0.7/libde265/sps.cc:904:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(curr_scaling_list, default_ScalingList_4x4, 16);
data/libde265-1.0.7/libde265/sps.cc:908:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
              { memcpy(curr_scaling_list, default_ScalingList_8x8_intra,64); }
data/libde265-1.0.7/libde265/sps.cc:910:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
              { memcpy(curr_scaling_list, default_ScalingList_8x8_inter,64); }
data/libde265-1.0.7/libde265/sps.cc:920:11:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
          memcpy(curr_scaling_list, scaling_list[mID], len);
data/libde265-1.0.7/libde265/sps.h:164:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char used_by_curr_pic_lt_sps_flag[MAX_NUM_LT_REF_PICS_SPS];
data/libde265-1.0.7/libde265/util.cc:34:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(dst, src, w);
data/libde265-1.0.7/libde265/visualize.cc:67:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* fh = fopen(filename, "wb");
data/libde265-1.0.7/libde265/vps.h:67:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char profile_compatibility_flag[32]; // to which profile we are compatible
data/libde265-1.0.7/libde265/x86/sse-motion.cc:61:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char buf[16];
data/libde265-1.0.7/sherlock265/VideoDecoder.cc:201:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(visu.AskFrame(BitmapChannel(map[0]))[y],
data/libde265-1.0.7/sherlock265/VideoDecoder.cc:206:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(visu.AskFrame(BitmapChannel(map[1]))[y],
data/libde265-1.0.7/sherlock265/VideoDecoder.cc:211:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(visu.AskFrame(BitmapChannel(map[2]))[y],
data/libde265-1.0.7/sherlock265/VideoDecoder.cc:436:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  mFH = fopen(filename,"rb");
data/libde265-1.0.7/tools/gen-entropy-table.cc:339:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    FILE* fh = fopen("streamdump-paris-intra","r");
data/libde265-1.0.7/tools/gen-entropy-table.cc:434:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* fh = fopen("streamdump-paris-intra","r");
data/libde265-1.0.7/tools/rd-curves.cc:380:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  istr.open("/tmp/xtmp");
data/libde265-1.0.7/tools/rd-curves.cc:402:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  istr.open("/tmp/ytmp");
data/libde265-1.0.7/tools/rd-curves.cc:1012:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    case 'f': maxFrames=atoi(optarg); break;
data/libde265-1.0.7/tools/rd-curves.cc:1022:18:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  int presetID = atoi( argv[optind] );
data/libde265-1.0.7/tools/rd-curves.cc:1061:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  output_fh = fopen(data_filename.str().c_str(), "wb");
data/libde265-1.0.7/tools/yuv-distortion.cc:46:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(coded[y], img1 + y*width, width);
data/libde265-1.0.7/tools/yuv-distortion.cc:47:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(ref[y],   img2 + y*width, width);
data/libde265-1.0.7/tools/yuv-distortion.cc:66:18:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* fh_ref = fopen(argv[1],"rb");
data/libde265-1.0.7/tools/yuv-distortion.cc:67:18:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* fh_cmp = fopen(argv[2],"rb");
data/libde265-1.0.7/tools/yuv-distortion.cc:69:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  int width  = atoi(argv[3]);
data/libde265-1.0.7/tools/yuv-distortion.cc:70:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  int height = atoi(argv[4]);
data/libde265-1.0.7/dec265/hdrcopy.cc:49:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  nal_hdr.read(&reader);
data/libde265-1.0.7/dec265/hdrcopy.cc:64:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      vps.read(&errqueue, &reader);
data/libde265-1.0.7/dec265/hdrcopy.cc:71:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      sps.read(&errqueue, &reader);
data/libde265-1.0.7/enc265/enc265.cc:275:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (strlen(inout_params.reconstruction_yuv.get().c_str()) != 0) {
data/libde265-1.0.7/extra/getopt_long.c:176:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			current_argv_len = strlen(current_argv);
data/libde265-1.0.7/extra/getopt_long.c:182:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			if (strlen(long_options[i].name) == (unsigned)current_argv_len) { 
data/libde265-1.0.7/libde265/decctx.cc:534:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  de265_error err = new_vps->read(this,&reader);
data/libde265-1.0.7/libde265/decctx.cc:555:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if ((err=new_sps->read(this, &reader)) != DE265_OK) {
data/libde265-1.0.7/libde265/decctx.cc:574:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  bool success = new_pps->read(&reader,this);
data/libde265-1.0.7/libde265/decctx.cc:626:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  de265_error err = shdr->read(&reader,this, &continueDecoding);
data/libde265-1.0.7/libde265/decctx.cc:1080:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(1000);
data/libde265-1.0.7/libde265/decctx.cc:1196:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  nal_hdr.read(&reader);
data/libde265-1.0.7/libde265/image.cc:62:45:  [1] (free) memalign:
  On some systems (though not Linux-based systems) an attempt to free()
  results from memalign() may fail. This may, on a few systems, be
  exploitable. Also note that memalign() may not check that the boundary
  parameter is correct (CWE-676). Use posix_memalign instead (defined in
  POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD
  4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases,
  malloc()'s alignment may be sufficient.
#define ALLOC_ALIGNED(alignment, size)      memalign((alignment), (size))
data/libde265-1.0.7/libde265/nal.cc:26:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void nal_header::read(bitreader* reader)
data/libde265-1.0.7/libde265/nal.h:43:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void read(bitreader* reader);
data/libde265-1.0.7/libde265/pps.cc:47:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
bool pps_range_extension::read(bitreader* br, decoder_context* ctx, const pic_parameter_set* pps)
data/libde265-1.0.7/libde265/pps.cc:270:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
bool pic_parameter_set::read(bitreader* br, decoder_context* ctx)
data/libde265-1.0.7/libde265/pps.cc:509:38:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      bool success = range_extension.read(br, ctx, this);
data/libde265-1.0.7/libde265/pps.h:44:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  bool read(bitreader*, decoder_context*, const pic_parameter_set*);
data/libde265-1.0.7/libde265/pps.h:65:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  bool read(bitreader*, decoder_context*);
data/libde265-1.0.7/libde265/slice.cc:356:35:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
de265_error slice_segment_header::read(bitreader* br, decoder_context* ctx,
data/libde265-1.0.7/libde265/slice.h:136:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  de265_error read(bitreader* br, decoder_context*, bool* continueDecoding);
data/libde265-1.0.7/libde265/sps.cc:198:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
de265_error seq_parameter_set::read(error_queue* errqueue, bitreader* br)
data/libde265-1.0.7/libde265/sps.cc:210:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  profile_tier_level_.read(br, sps_max_sub_layers);
data/libde265-1.0.7/libde265/sps.cc:428:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    vui.read(errqueue, br, this);
data/libde265-1.0.7/libde265/sps.cc:443:39:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    de265_error err = range_extension.read(errqueue, br);
data/libde265-1.0.7/libde265/sps.cc:1261:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
de265_error sps_range_extension::read(error_queue* errqueue, bitreader* br)
data/libde265-1.0.7/libde265/sps.h:81:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  de265_error read(error_queue*, bitreader*);
data/libde265-1.0.7/libde265/sps.h:91:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  de265_error read(error_queue*, bitreader*);
data/libde265-1.0.7/libde265/vps.cc:102:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
de265_error video_parameter_set::read(error_queue* errqueue, bitreader* reader)
data/libde265-1.0.7/libde265/vps.cc:119:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  profile_tier_level_.read(reader, vps_max_sub_layers);
data/libde265-1.0.7/libde265/vps.cc:310:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void profile_data::read(bitreader* reader)
data/libde265-1.0.7/libde265/vps.cc:334:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
void profile_tier_level::read(bitreader* reader,
data/libde265-1.0.7/libde265/vps.cc:341:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  general.read(reader);
data/libde265-1.0.7/libde265/vps.cc:362:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      sub_layer[i].read(reader);
data/libde265-1.0.7/libde265/vps.h:53:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void read(bitreader* reader);
data/libde265-1.0.7/libde265/vps.h:85:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void read(bitreader* reader, int max_sub_layers);
data/libde265-1.0.7/libde265/vps.h:132:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  de265_error read(error_queue* errqueue, bitreader* reader);
data/libde265-1.0.7/libde265/vui.cc:148:42:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
de265_error video_usability_information::read(error_queue* errqueue, bitreader* br,
data/libde265-1.0.7/libde265/vui.h:50:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  de265_error read(error_queue*, bitreader*, const seq_parameter_set*);
data/libde265-1.0.7/tools/gen-entropy-table.cc:43:13:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int c = fgetc(fh);
data/libde265-1.0.7/tools/rd-curves.cc:85:30:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      str = str.replace(pos, strlen(variables[i].name), variables[i].value);

ANALYSIS SUMMARY:

Hits = 186
Lines analyzed = 60968 in approximately 1.61 seconds (37969 lines/second)
Physical Source Lines of Code (SLOC) = 40890
Hits@level = [0] 284 [1]  42 [2] 104 [3]  17 [4]  23 [5]   0
Hits@level+ = [0+] 470 [1+] 186 [2+] 144 [3+]  40 [4+]  23 [5+]   0
Hits/KSLOC@level+ = [0+] 11.4943 [1+] 4.54879 [2+] 3.52164 [3+] 0.978234 [4+] 0.562485 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.