The following issues were found
doc/examples/resampling_audio.c
1 issues
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
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
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
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
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
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
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
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
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
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.