The following issues were found

libavutil/tests/pca.c
1 issues
printf - If format strings can be influenced by an attacker, they can be exploited
Security

Line: 25 Column: 8 CWE codes: 134
Suggestion: Use a constant for the format specification

              #include "libavutil/pca.c"
#include "libavutil/lfg.h"

#undef printf
#include <stdio.h>
#include <stdlib.h>

int main(void){
    PCA *pca;

            

Reported by FlawFinder.

libavutil/tests/random_seed.c
1 issues
printf - If format strings can be influenced by an attacker, they can be exploited
Security

Line: 24 Column: 8 CWE codes: 134
Suggestion: Use a constant for the format specification

              #define TEST 1
#include "libavutil/random_seed.c"

#undef printf
#define N 256
#define F 2
#include <stdio.h>

typedef uint32_t (*random_seed_ptr_t)(void);

            

Reported by FlawFinder.

libavutil/tests/ripemd.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 31 Column: 14 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              {
    int i, j, k;
    struct AVRIPEMD *ctx;
    unsigned char digest[40];
    static const int lengths[4] = { 128, 160, 256, 320 };

    ctx = av_ripemd_alloc();
    if (!ctx)
        return 1;

            

Reported by FlawFinder.

libavutil/tests/sha.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 28 Column: 14 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              {
    int i, j, k;
    struct AVSHA *ctx;
    unsigned char digest[32];
    static const int lengths[3] = { 160, 224, 256 };

    ctx = av_sha_alloc();
    if (!ctx)
        return 1;

            

Reported by FlawFinder.

libavutil/tests/sha512.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 33 Column: 14 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              {
    int i, j, k;
    struct AVSHA512 *ctx;
    unsigned char digest[64];
    static const int lengths[4] = { 224, 256, 384, 512 };

    ctx = av_sha512_alloc();
    if (!ctx)
        return 1;

            

Reported by FlawFinder.

libavutil/tests/tree.c
1 issues
atoi - Unless checked, the resulting number can exceed the expected range
Security

Line: 68 Column: 47 CWE codes: 190
Suggestion: 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)

                  void *k;
    AVTreeNode *root = NULL, *node = NULL;
    AVLFG prng;
    int log_level = argc <= 1 ? AV_LOG_INFO : atoi(argv[1]);

    av_log_set_level(log_level);

    av_lfg_init(&prng, 1);


            

Reported by FlawFinder.

libavutil/thread.h
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 37 Column: 5 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              #include "log.h"

#define ASSERT_PTHREAD_ABORT(func, ret) do {                            \
    char errbuf[AV_ERROR_MAX_STRING_SIZE] = "";                         \
    av_log(NULL, AV_LOG_FATAL, AV_STRINGIFY(func)                       \
           " failed with error: %s\n",                                  \
           av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE,       \
                                AVERROR(ret)));                         \
    abort();                                                            \

            

Reported by FlawFinder.

libavutil/time.c
1 issues
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
Security

Line: 91 Column: 12 CWE codes: 676
Suggestion: Use nanosleep(2) or setitimer(2) instead

                  while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
    return 0;
#elif HAVE_USLEEP
    return usleep(usec);
#elif HAVE_SLEEP
    Sleep(usec / 1000);
    return 0;
#else
    return AVERROR(ENOSYS);

            

Reported by FlawFinder.

libavutil/timecode.c
1 issues
snprintf - If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate
Security

Line: 167 Column: 5 CWE codes: 134
Suggestion: Use a constant for the format specification

              
char *av_timecode_make_mpeg_tc_string(char *buf, uint32_t tc25bit)
{
    snprintf(buf, AV_TIMECODE_STR_SIZE,
             "%02"PRIu32":%02"PRIu32":%02"PRIu32"%c%02"PRIu32,
             tc25bit>>19 & 0x1f,              // 5-bit hours
             tc25bit>>13 & 0x3f,              // 6-bit minutes
             tc25bit>>6  & 0x3f,              // 6-bit seconds
             tc25bit     & 1<<24 ? ';' : ':', // 1-bit drop flag

            

Reported by FlawFinder.

libavutil/timer.h
1 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 127 Column: 5 CWE codes: 120 20

              
#define STOP_TIMER(id)                                                      \
    ioctl(linux_perf_fd, PERF_EVENT_IOC_DISABLE, 0);                        \
    read(linux_perf_fd, &tperf, sizeof(tperf));                             \
    TIMER_REPORT(id, tperf)

#elif CONFIG_MACOS_KPERF

#define START_TIMER                                                         \

            

Reported by FlawFinder.