The following issues were found

doc/examples/resampling_audio.c
1 issues
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?
Security

Line: 108 Column: 16 CWE codes: 362

                  }
    dst_filename = argv[1];

    dst_file = fopen(dst_filename, "wb");
    if (!dst_file) {
        fprintf(stderr, "Could not open destination file %s\n", dst_filename);
        exit(1);
    }


            

Reported by FlawFinder.

doc/examples/scaling_video.c
1 issues
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?
Security

Line: 83 Column: 16 CWE codes: 362

                      exit(1);
    }

    dst_file = fopen(dst_filename, "wb");
    if (!dst_file) {
        fprintf(stderr, "Could not open destination file %s\n", dst_filename);
        exit(1);
    }


            

Reported by FlawFinder.

fftools/ffmpeg_hw.c
1 issues
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)
Security

Line: 78 Column: 17 CWE codes: 126

                  char *name;
    size_t index_pos;
    int index, index_limit = 1000;
    index_pos = strlen(type_name);
    name = av_malloc(index_pos + 4);
    if (!name)
        return NULL;
    for (index = 0; index < index_limit; index++) {
        snprintf(name, index_pos + 4, "%s%d", type_name, index);

            

Reported by FlawFinder.

libavcodec/4xm.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 906 Column: 9 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                          return AVERROR(ENOMEM);
        }

        memcpy(cfrm->data + cfrm->size, buf + 20, data_size);
        cfrm->size += data_size;

        if (cfrm->size >= whole_size) {
            buf        = cfrm->data;
            frame_size = cfrm->size;

            

Reported by FlawFinder.

libavcodec/aac_adtstoasc_bsf.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 116 Column: 13 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                      put_bits(&pb, 1, 0); //is not extension
        flush_put_bits(&pb);
        if (pce_size) {
            memcpy(extradata + 2, pce_data, pce_size);
        }

        ctx->first_frame_done = 1;
    }


            

Reported by FlawFinder.

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

Line: 78 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

                      * (lambda / 120.f);
    int refbits = destbits;
    int toomanybits, toofewbits;
    char nzs[128];
    uint8_t nextband[128];
    int maxsf[128], minsf[128];
    float dists[128] = { 0 }, qenergies[128] = { 0 }, uplims[128], euplims[128], energies[128];
    float maxvals[128], spread_thr_r[128];
    float min_spread_thr_r, max_spread_thr_r;

            

Reported by FlawFinder.

libavcodec/aacpsy.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 845 Column: 5 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                      }
    }

    memcpy(pch->prev_band, pch->band, sizeof(pch->band));
}

static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
                                   const float **coeffs, const FFPsyWindowInfo *wi)
{

            

Reported by FlawFinder.

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

Line: 1788 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

              #ifdef DEBUG
    AVCodecContext *avctx = s->avctx;
    AC3EncOptions *opt = &s->options;
    char strbuf[32];

    switch (s->bitstream_id) {
    case  6:  av_strlcpy(strbuf, "AC-3 (alt syntax)",       32); break;
    case  8:  av_strlcpy(strbuf, "AC-3 (standard)",         32); break;
    case  9:  av_strlcpy(strbuf, "AC-3 (dnet half-rate)",   32); break;

            

Reported by FlawFinder.

libavcodec/adpcm.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If CASE_CONFIG_ADPCM_IMA_QT_DECODER is a macro then please configure it.
Error

Line: 1095

                  st = avctx->channels == 2 ? 1 : 0;

    switch(avctx->codec->id) {
    CASE(ADPCM_IMA_QT,
        /* In QuickTime, IMA is encoded by chunks of 34 bytes (=64 samples).
           Channel data is interleaved per-chunk. */
        for (int channel = 0; channel < avctx->channels; channel++) {
            ADPCMChannelStatus *cs = &c->status[channel];
            int predictor;

            

Reported by Cppcheck.

libavcodec/adpcmenc.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If CASE_CONFIG_ADPCM_SWF_ENCODER is a macro then please configure it.
Error

Line: 166

                      avctx->frame_size  = s->block_size * 2 / avctx->channels;
        avctx->block_align = s->block_size;
        ) /* End of CASE */
    CASE(ADPCM_SWF,
        if (avctx->sample_rate != 11025 &&
            avctx->sample_rate != 22050 &&
            avctx->sample_rate != 44100) {
            av_log(avctx, AV_LOG_ERROR, "Sample rate must be 11025, "
                   "22050 or 44100\n");

            

Reported by Cppcheck.